0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[AtCoder備忘録記事]AtCoder Beginner Contest 348 A問題

Posted at

AtCoder Beginner Contest 348 A問題
こちらの問題です。

問題

image.png

入出力例

image.png

解法

簡単ですね。
forでまわして3の倍数の時に×を出力します。

#include <iostream>
#include <vector>
#include <string>
#include <unordered_set>
#include <cmath> 
#include <algorithm>
using namespace std;

int main() {
    int N;
    cin >> N;
    for(int i = 1; i <= N; i++){
        if(i % 3 == 0){
            cout << "x";
        }else{
            cout << "o";
        }
    }
}

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?