21 条题解

  • 1
    @ 2023-8-7 16:36:28
    #include<bits/stdc++.h>
    #include<cstring>
    #include<queue>
    #include<set>
    #include<stack>
    #include<vector>
    #define ll long long
    using namespace std;
    const int N=1e5+10;
    const int M=2023;
    const int inf=0x3f3f3f3f;
    int n,m,k;
    void dfs(int n)
    {
    	if(n<=0)return;
    	cout<<n%10;
    	dfs(n/10);
    }
    int main()
    {
    	cin>>n;
    	dfs(n);
    	return 0;
    }
    
    • 1
      @ 2023-6-4 10:45:41
      #include<iostream>
      using namespace std;
      //#define LL long long
      //const int N = 1e6 + 10;
      //const int INF = 0x3f3f3f3f;
      //int a[10][10];
      int a;
      int main(){
      	cin>>a;
      	while(a){
      		cout<<a%10;
      		a/=10;
      	}
      }
      
      • 1
        @ 2023-5-11 21:17:02
        #include 
        using namespace std;
        int main() 
        {
            string n;
            getline(cin, n);
            for (int i = n.size() - 1; i >= 0; i--) 
        	{
                cout << n[i];
            }
            return 0;
        }
        

        这题很简单,建议用字符串做,不然那个“0”会很麻烦(>ω・* )ノ

        • 1
          @ 2023-1-23 14:58:00
          #include<iostream>
          using namespace std;
          int main(){
          	string a;
          	cin>>a;
          	for(int i = a.size()-1; i >= 0; i -- ){
          		cout<<a[i];
          	}
          	return 0;
          }
          
          
          
          • 1
            @ 2022-9-29 21:24:07

            #include<stdio.h> #include<iostream> using namespace std; int main() { char a,b,c; cin >>a >>b >>c; cout<< c<< b<< a;

            }

            • 0
              @ 2024-10-20 20:04:32

              递归:

              #include<cstdio>
              #include<iostream>
              #include<cstring>
              #include<cmath>
              #include<iomanip>
              #include<queue>
              #include<algorithm>
              #include<vector>
              #include<stack>
              #include<set>
              using namespace std;
              #define LL long long
              const int N=100;
              using namespace std;
              int f(int n,int m)
              {
              	f(n%2)
              }
              int main()
              {
              	int a,b;
              	cin>>a>>b;
              	cout<<f(a,b);
              	return 0;
              }
              
              
              • 0
                @ 2023-12-14 22:43:38
                #include<stdio.h>
                int main()
                {
                    int n,a,b,c;
                    scanf("%d",&n);
                    a=n/100;
                    b=n/10%10;
                    c=n%10;
                    printf("%d%d%d\n",c,b,a);
                    return 0;
                }
                
                • -1

                  需要这么难?

                  #include <iostream>
                  #include <bits/stdc++.h>
                  using namespace std;
                  const int N=1e7+10;
                  const int INF=0x3f3f3f3f;
                  int main()
                  {
                  	int a;
                  	cin>>a;
                  	cout<<a%10<<a/10%10<<a/100%10;
                  }
                  
                  • -1
                    @ 2023-4-22 14:42:11

                    #include<iostream> using namespace std; int main(){ int n; cin>>n; cout<<n%10; cout<<n%100/10; cout<<n/100; return 0;

                    }

                    • -1
                      @ 2023-4-22 14:41:33

                      #include<iostream> using namespace std; int main(){ int n; cin>>n; cout<<n%10; cout<<n%100/10; cout<<n/100; return 0;

                      }

                      • -1
                        @ 2023-4-20 20:38:42

                        #include<iostream>

                        using namespace std;

                        int a[1111];

                        int main(){ int n;

                        cin>>n;
                        for(int i=1;i<=3;i++){
                        	cout<<n%10;
                        	n/=10;
                        }
                        

                        }

                        • -3
                          @ 2023-3-12 18:22:32
                          #include<iostream>
                          using namespace std;
                          int main(){
                          	string a;
                          	cin>>a;
                          	for(int i = a.size()-1; i >= 0; i -- ){
                          		cout<<a[i];
                          	}
                          	return 0;
                          }
                          
                          • -4
                            @ 2022-10-4 12:00:00
                            #include <iostream> 
                            using namespace std; 
                            int main()
                            { 
                                int n; 
                                cin>>n; 
                                int ge=n%10; 
                                int shi=n/10%10; 
                                int bai=n/100; 
                                cout<<ge<<shi<<bai; 
                            }
                            
                            • -4

                              #include <iostream> using namespace std; int main(){ int n; cin>>n; int ge=n%10; int shi=n/10%10; int bai=n/100; cout<<ge<<shi<<bai; }

                              • -4
                                @ 2022-8-24 21:19:28
                                #include <bits/stdc++.h>
                                
                                using namespace std;
                                
                                int main(void)
                                {
                                	int a;
                                
                                	cin >> a;
                                
                                	int x, y, z;
                                
                                	x = a % 100 % 10;
                                	y = (a % 100 - x) / 10;
                                	z = (a - y * 10 - x) / 100;
                                
                                	cout << x << y << z;
                                
                                	return 0;
                                }
                                
                                • -4
                                  @ 2022-8-13 19:05:23
                                  #include <iostream>
                                  #include <algorithm>
                                  #include <cstdio>
                                  #include <cstring>
                                  #include <string>
                                  #include <iomanip>
                                  #include <cmath>
                                  #include <queue>
                                  #include <map>
                                  #include <stack>
                                  #include <vector>
                                  using namespace std;
                                  #define long long LL
                                  const int N = 1e6+6;
                                  const int INF = 0x3f3f3f3f;
                                  int main(){
                                      string s;
                                      cin >> s;
                                      for (int i = 2;i>=0;i--){
                                          cout << s[i];
                                      }
                                      return 0;
                                  }
                                  
                                  • -5
                                    @ 2022-7-2 8:20:15
                                    /*****************************************
                                    备注:
                                    ******************************************/
                                    #include <queue>
                                    #include <math.h>
                                    #include <stack>
                                    #include <stdio.h>
                                    #include <iostream>
                                    #include <vector>
                                    #include <iomanip>
                                    #include <string.h>
                                    #include <algorithm>
                                    using namespace std;
                                    #define LL long long
                                    const int N = 1e5 + 10;
                                    const int INF = 0x3f3f3f3f;
                                    int main(){
                                    	int n;
                                    	cin>>n;
                                    	int ge=n%10;
                                    	int shi=n/10%10;
                                    	int bai=n/100;
                                    	cout<<ge<<shi<<bai;
                                    	return 0;
                                    }
                                    • -5
                                      @ 2022-4-24 14:39:45

                                      #include <iostream> #include <cstdio> using namespace std; int main() { int a,b,c,d; cin>>d; a=d/100; b=d%100/10; c=d%10; cout<<c100+b10+a; return 0; }

                                      • -5
                                        @ 2022-1-24 9:32:51
                                        #include <stdio.h>
                                        #include <iostream>
                                        using namespace std;
                                        int main()
                                        {
                                        	int a;
                                        	cin >> a;
                                        	int b,g,s;
                                        	g = a%10;
                                        	b = a/100;
                                        	s = (a/10)%10;
                                        	// int t = s;
                                        	// s = t%10;
                                        	// s = s%10;
                                        	cout << g  << s  << b << endl;
                                        
                                        }
                                        
                                        • -6
                                          @ 2022-7-1 21:08:09
                                          #include <stdio.h>
                                          #include <iostream>
                                          using namespace std;
                                          int main()
                                          {
                                          	int a;
                                          	cin >> a;
                                          	int x,y,z;
                                          	x = a%10;
                                          	z = a/100;
                                          	y = a/10%10;
                                          	cout << x << y << z << endl;
                                          
                                          
                                          	
                                          	char a,b,c;
                                          	cin >> a >> b >> c;
                                          	cout << c << b << a  << endl;
                                          }
                                          

                                          信息

                                          ID
                                          837
                                          时间
                                          1000ms
                                          内存
                                          128MiB
                                          难度
                                          5
                                          标签
                                          递交数
                                          1647
                                          已通过
                                          610
                                          上传者