公式
A - Print 341 解説 by en_translator
For beginners
- If you are new to learning programming and do not know where to start, please try Problem A "Welcome to AtCoder" from practice contest. There you can find a sample code for each language.
- Also, if you are not familiar with problems in programming contests, we recommend you to try some problems in "AtCoder Beginners Selection".
- 「C++入門 AtCoder Programming Guide for beginners (APG4b)」 is a C++ tutorial for competitive programmers. Sadly, this is only in Japanese too.
For example, one can solve the problem by printing 1
once, and then printing 01
\(N\) times.
To do so, one has to receive the integer \(N\) from standard input, and print a desired string to standard output. Do check how to achieve input and output in your programming language.
In order to print 01
exactly \(N\) times, one can use the loop feature (like the for
statement), which is a standard feature of a programming language.
The following is sample code in C++ language.
#include <iostream>
using namespace std;
int main(void)
{
int n;
cin >> n;
cout << "1";
for(int i = 1; i <= n; i++) cout << "01";
cout << endl;
return 0;
}
投稿日時:
最終更新: