A - Penalty Kick
我又又又回来啦
题目:
Problem Statement
Takahashi will have N N N penalty kicks in a soccer match.
For the i i i-the enalty kick, he will fail if i i i is a multiple of 3 3 3, and succeed otherwise . . .
Print the results of his penalty kicks . . .
Constraints
- 1 ≤ N ≤ 100 1 \leq N \leq 100 1≤N≤100
- All inputs are integers . . .
Input
The input is given from Standard Input in the following format : : :
N
Output
Print a string of length  
     
      
       
       
         N 
        
       
      
        N 
       
      
    N representing the results of Takahashi’s penalty kicks. The  
     
      
       
       
         i 
        
       
      
        i 
       
      
    i-th character  
     
      
       
       
         ( 
        
       
         1 
        
       
         ≤ 
        
       
         i 
        
       
         ≤ 
        
       
         N 
        
       
         ) 
        
       
      
        (1 \leq i \leq N) 
       
      
    (1≤i≤N) should be o if Takahashi succeeds in the  
     
      
       
       
         i 
        
       
      
        i 
       
      
    i-th penalty kick 
     
      
       
       
         , 
        
       
      
        , 
       
      
    , and x if he fails 
     
      
       
       
         . 
        
       
      
        . 
       
      
    .

 很好,思路:
先输入 
     
      
       
       
         N 
        
       
      
        N 
       
      
    N, 
     
      
       
       
         f 
        
       
         o 
        
       
         r 
        
       
      
        for 
       
      
    for循环看看当前i是不是 
     
      
       
       
         3 
        
       
      
        3 
       
      
    3的倍数 
     
      
       
       
         , 
        
       
      
        , 
       
      
    ,如是 
     
      
       
       
         , 
        
       
      
        , 
       
      
    ,输出o 
     
      
       
       
         , 
        
       
      
        , 
       
      
    ,否则输出x 
     
      
       
       
         . 
        
       
      
        . 
       
      
    .
ACcode:
//コード通過,by zhimajiazhu0316。コピー/復制/商用禁止です。
#include <iostream>		// 基本入出力ストリーム
#include <algorithm>	// 一般的なアルゴリズム(ソート、ルックアップ、やり直し、二分ルックアップなど)
#include <vector>		// 動的配列(スペースが足りないと自動的に拡張されます)
#include <queue>		//  スタック(先に入って先に出ます)
#include <stack>		// スタック(先に入ってから出ます)
#include <set>			// 集合(反復しない順序)です
#include <map>			// キー値対コンテナ(マッピング)
#include <list>			//  両方向リスト
#include <math.h>		//  すうがくかんすう
#include <functional>	// 通用的函数绑定和调用机制一般的なバインディングと呼び出しの仕組み
#define endl '\n'
#define pii pair<int, int>
#define pdd pair<double, double>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using namespace std;
const int inf = 1e9 + 7;
const int mod = 998244353;
const int N = 2e5 + 10, M = N << 1;
void solve(){
    // 竞赛程序
    int n;
    cin>>n;
    for(int i=1;i<=n;i++){
    	if(i%3==0){
    		cout<<"x";
		}
		else{
			cout<<"o";
		}
	}
}
signed main(){
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int t = 1;
//	cin >> t;	// 非多组测试数据请注释该行
    while(t--) solve();
    return 0;
}
okk今天就到这吧



















