5 条题解

  • 3
    @ 2022-3-16 19:02:15
    #include <stdio.h>
    #include <iostream>
    #include <math.h>
    using namespace std;
    int main()
    {
    	int n ;
    	cin >> n;
    	int m = n;
    	int len =0;
    	for(int i = 0 ; n!= 0 ; i++)
    	{
    		n/=100;
    		len++;
    	}
    
    	for(int i = len ;i > 0 ;i--)
    	{
    		int p = pow(100,i-1);
    		n = m / p;
    		if(n < 10 && i != len)
    		{
    			cout << "0";
    		}
    		cout << n << " ";
    		m = m%p;
    	}
    
    }
    
    • 0
      @ 2024-2-10 23:07:38
      #include<bits/stdc++.h>
      #define ll long long
      using namespace std;
      const int N=1e6+10;
      const int INF=0x3f3f3f3f;
      inline int read(){int x=0,f=1;char ch=getchar();while (ch<'0'||ch>'9'){if (ch=='-') f=-1;ch=getchar();}while (ch>='0'&&ch<='9'){x=x*10+ch-48;ch=getchar();}return x*f;}
      string s;
      int main(){
      	//freopen(".in","r",stdin);
      	//freopen(".out","w",stdout);
      	cin>>s;
      	if(s.size()%2==0)for(int i=0;i<s.size();i+=2)cout<<s[i]<<s[i+1]<<" "; 
      	else{
      		cout<<s[0]<<" ";
      		for(int i=1;i<s.size();i+=2)cout<<s[i]<<s[i+1]<<" ";
      	}
      }
      
      
      • 0
        @ 2023-12-19 17:01:57
        #include <iostream>
        #include <cmath> 
        using namespace std;
        const int INF = 0x3f3f3f3f;
        const int N = 1e5 + 10;
        
        int n , ans , tmp;
        
        int main()
        {
        	cin >> n;
        	tmp = n;
        	//分段
        	while( tmp )
        	{
        		tmp /= 100;
        		ans++;
        	} 
        	
        	for(int i = ans - 1; i >= 0; i--)//
        	{
        		int tmp1 = pow(100 , i) ;
        		
        		if(n / tmp1 < 10 && i != ans - 1)
        			cout << "0";
        		cout << n / tmp1 << " ";
        		n %= tmp1; 
        	}
        	
        
            return 0;
        }
        
        • 0
          @ 2023-12-19 17:01:50
          #include <stdio.h>
          #include <iostream>
          #include <math.h>
          using namespace std;
          int main()
          {int n ;cin >> n;int m = n;int len =0;for(int i = 0 ; n!= 0 ; i++){n/=100;len++;}for(int i = len ;i > 0 ;i--){int p = pow(100,i-1);n = m / p;if(n < 10 && i != len){cout << "0";}cout << n << " ";m = m%p;}}
          
          • -1
            @ 2022-2-11 11:32:38

            #include<iostream> #include<iomanip> #include<math.h> #include<stdio.h> using namespace std; int main() { int n; cin>>n; int m=n; int len=0; for(int i = 0;n!=0;i++) { n/=100; len++; } for(int i = len;i>0;i--) { int p=pow(100,i-1); n=m/p; if(n < 10&&i != len) { cout<<"0"; } cout<<n<<" "; m=m%p; } }

            • 1

            信息

            ID
            944
            时间
            1000ms
            内存
            256MiB
            难度
            5
            标签
            递交数
            428
            已通过
            163
            上传者