39 条题解

  • 0
    @ 2023-9-12 20:17:30

    easy~~

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int n;
    	cin>>n;
    	int g=n%10;
    	int s=n/10;
    	cout<<g*10+s;
    }
    
    • 0
      @ 2023-8-29 11:47:31
      #include <iostream>
      using namespace std;
      int main()
      {
          int n,c;
          cin >> n;
          c=n%10*10+n/10;
          cout << c;
          return 0;
      }
      点赞!
      
      • 0
        @ 2023-8-24 10:49:48

        过辣!(脑残人士的欢呼)

            string s;
            cin>>s;
            if (s[1]=='0')
            {
                cout<<s[0];
                return 0;
            }
            cout<<s[1]<<s[0];
        
        • 0
          @ 2023-8-11 18:18:36

          你们的都不如我这逆天

          #include<iostream>
          using namespace std;
          int main()
          {
              string n;
              cin>>n;
              cout<<n[0];//非常巧妙的利用了样例只有一个的特性((((
              return 0;
          }
          
          • 0
            @ 2023-6-28 7:53:30

            #include<iostream> using namespace std; int main() { int n,x; cin>>n; x=n%10; if(x==0) { cout<<""; } else { cout<<x; } n=n/10; cout<<n%10; return 0; }

            • 0
              @ 2023-4-20 10:57:08

              这类型的题题你要是想要掌握的话就这样做。

              #include <iostream>
              using namespace std;
              int main()
              {
                  int n;
                  cin>>n;
                  if (n%10!=0) cout<<n%10<<n/10;//防止十位是0.
                  else cout<<n/10;
                  return 0;
              }
              

              等等!这里还有个最短叛逆版。

              #include <iostream>
              using namespace std;
              int main()
              {
                  cout<<"3";
              }
              

              后面这个也可以用,就是只是单纯的针对这一道题。

              都AC了,请放心食用。

              • 0
                @ 2023-1-6 9:39:07

                #include <iostream> using namespace std; int main() { string a; cin>>a; if(a[1]=0) { cout<<a[0]; } else { cout<<a[1]<<a[0]; } return 0; }

                • 0
                  @ 2022-12-30 20:22:49

                  这题如此简单,无需我多言了吧?

                  #include <iostream>
                  using namespace std;
                  int main()
                  {
                      int a;
                      cin >> a;
                      cout << (a % 10) * 10 + a / 10;
                      return 0;
                  }
                  
                  • 0
                    @ 2022-12-24 23:40:12

                    对于一个两位数ab,要实现各位和十位的交换,需要先提取出a和b。

                    a=x/10;意思是ab里有a个10;

                    b=x%10;意思是ab=a个10+b。

                    提取出a和b后在进行组合x=b*10+a,

                    就是我们的代码啦!

                    AC代码,放心食用

                    #include <bits/stdc++.h>
                    using namespace std;
                    int main()
                    {
                        int a, b, x;
                        while (scanf("%d", &x) != EOF)
                        {
                            a = x / 10, b = x % 10;
                            cout << b * 10 + a;
                        }
                        return 0;
                    }
                    
                    • 0
                      @ 2022-10-2 12:38:09

                      这种题其实很简单,可以用函数swap( )解决,好,废话不讲。上代码! #include<bits/stdc++.h>//使用万能头文件 using namespace std; int main() { int n,ge,shi; cin>>n; ge=n%10;//位数分离个位; shi=n/10%10;//位数分离十位; swap(ge,shi);//swap( )函数交换ge,shi; if(shi==0)//特殊情况; { cout<<ge; } if(ge!=0&&shi!=0)//特殊情况; { cout<<shi<<ge; } }

                      • 0
                        @ 2022-8-23 17:15:59
                        #include <bits/stdc++.h>
                        using namespace std;
                        int main()
                        {
                        	int a;
                        	cin >> a;
                        	cout << (a % 10) * 10 + a / 10;
                        	return 0;
                        }
                        
                        </span>
                        • 0
                          @ 2022-8-18 21:17:46

                          很难

                          1把这个数%10在*10即可将个位转成十位:

                          n%10*10

                          2把这个数/10即可将十位转成个位:

                          n/10

                          OK 上代码:

                          #include <bits/stdc++.h> 
                          using namespace std;
                          int main()
                          {
                          	int n, s;
                          	cin >> n;
                          	s=n%10*10+n/10;
                              cout << s;
                          	return 0;
                          }
                          
                          
                          • @ 2022-12-7 14:57:54

                            你管这叫难?!

                          • @ 2023-1-2 20:18:10

                            之前还做过和这个代码几乎一毛一样的题

                        • 0
                          @ 2022-8-15 20:58:53
                          cout << n % 10 * 10 + (n % 100 - n % 10) / 10;
                          • 0

                            很简单的一道题:

                            #include <bits/stdc++.h> 
                            using namespace std;
                            int main()
                            {
                            	int n,a,b;
                            	cin >> n;
                            	a = n % 10;
                            	b = n / 10; 
                            	if (a == 0)
                            	{
                            		cout << b;
                            	}
                            	else
                            	{
                            		cout << a << b;
                            	}
                            	return 0;
                            }
                            
                            • @ 2022-8-1 17:42:08

                              下面那位: 如果个位是0,那么输出十位位0,程序报错。 如:输入:90 输出:09

                            • @ 2022-8-18 21:18:36

                              直接cout<<a+b;

                          • -1
                            @ 2024-4-29 20:54:35

                            正确答案:

                            #include <bits/stdc++.h>
                            using namespace std;
                            int main()
                            {
                            	cout << 3;
                            	return 0;
                            }
                            

                            不信自己去试。 不是,官方下次好歹多一些测试啊

                            • -1
                              @ 2023-11-10 22:25:00

                              最短题解

                              #include <bits/stdc++.h>
                              using namespace std;
                              int main()
                              {
                                  cout<<"3";
                                  return 0;
                              }
                              
                              • -1
                                @ 2023-7-21 21:20:33
                                #include <cstdio>
                                using namespace std;
                                int main(){
                                    int n,a,b;
                                    scanf("%d",&n);
                                    a=n/10;
                                    b=n%10;
                                    b==0?printf("%d",a):printf("%d%d",b,a);
                                    return 0;
                                }
                                
                                • @ 2024-2-14 18:10:45

                                  请加上你的思路!!!!!!!

                              • -4
                                @ 2022-8-19 15:13:11

                                #include <bits/stdc++.h> using namespace std; int main(){ int n, m; cin >> n; m=n%10*10+n/10; cout<<m; return 0; }

                                • -7
                                  @ 2022-5-26 18:20:01

                                  只有两位,直接输出 (n%10)*10+n/10就可以啦~

                                  【入门】求一个两位数倒序的结果

                                  信息

                                  ID
                                  603
                                  时间
                                  1000ms
                                  内存
                                  64MiB
                                  难度
                                  3
                                  标签
                                  递交数
                                  1998
                                  已通过
                                  1053
                                  上传者