11 条题解

  • 7
    @ 2022-10-3 15:43:51
    #include<stdio.h>
    int main(){
     	int i,tmp,input,sum=0;
    	scanf("%d",&input);
    	for(i=input;i;i/=10){
    		tmp=i%10;
    		sum=sum*10+tmp;		//计算出倒数 
    	}
        sum==input?printf("yes"):printf("no");
        return 0;
    }
    
    
    • 2
      @ 2023-10-24 17:50:23
      #include<stdio.h>
      #include <string.h>
      int main()
      {
      int lang;
      char str[1000],str1[1000];
      gets(str);
      lang=strlen(str);
      for (int i = 0; i < lang; i++)
      {
      str1[i] = str[lang - 1 - i];
      }
      //str[lang] = '\0';
      str1[lang] = '\0';
      /*printf("%s\n", str);
      printf("%s", str1);
      printf("%d", strcmp(str, str1));*/
      if (strcmp(str, str1)==0)
      {
      printf("yes");
      }
      else
      {
      printf("no");
      }
      return 0;
      }
      
      
      • 1
        @ 2023-7-28 2:07:29

        懒得算.png

        #include<iostream>
        using namespace std;
        int main() {
            string s;
            cin >> s;
            bool flag = 1;
            int longofNum = s.size();
            for (int i = 0;i < longofNum - 1;i++) {
                if (s[i] != s[longofNum - 1 - i]) flag = 0;
            }
            if (flag) cout << "yes";
            else cout << "no";
        }
        
        • 1
          @ 2022-10-3 23:20:33
          #include <iostream>
          #include <string.h>
          #include <stdio.h>
          #include <algorithm>
          using namespace std;
          int main()
          { 
           	int hws,b,sum=0;
           	cin>>hws;
           	for(int a=hws;a>0;a/=10)
           	{
           		b=a%10;//一次是个,2次十位,等等
          		sum=sum*10+b; 
          	 }
          	 if(sum==hws)
          	 {
          	 	cout<<"yes";
          	 
          	 }
          	 	else
          	 	cout<<"no";
          		return 0;
          }
          yujie好厉害
          
          • 0
            @ 2023-12-26 20:56:10

            #include<stdio.h> int main() { int i,n,j=0; int a[100]; int k=0; scanf("%d",&n); while(n>0) { i=n%10; a[j]=i; n=n/10; j=j+1; } for(i=0;i<j/2;i++) { if(a[i]!=a[j-1-i]) { k++; } } if(k==0) { printf("yes"); } else { printf("no"); } return 0; }

            • 0
              @ 2023-10-21 7:26:07

              #include<stdio.h> int isPalindrome(int x){ if(x<0){ return 0; } int div=1; while(x / div>=10){ div*=10; } while(x>0){ int left = x / div; int right = x % 10; if(left != right){ return 0; } x = (x % div)/10; div /= 100; } return 1; }

              int main() { int x; scanf("%d",&x); if(isPalindrome(x)){ printf("yes"); }else{ printf("no"); }

              return 0;
              

              }

              • 0
                @ 2023-9-30 16:20:13

                #include<stdio.h> int main(){ int X; int Y=0; scanf("%d",&X); for(int i=X;i>0;i=i/10){ Y=i%10+Y*10; } if(Y==X) printf("yes");

                else
                    printf("no");
                
                return 0;
                

                }

                • 0
                  @ 2022-10-26 0:10:29

                  #include<iostream> using namespace std;

                  int main() { int n,b; cin>>n; int a=n; while(n>0) { b=10*b+n%10; n/=10; } if(a==b) { cout<<"yes"<<endl; } else { cout<<"no"<<endl; } return 0; }

                  • 0
                    @ 2022-10-6 14:15:05

                    #include<stdio.h> int main(){ int n,a=0; scanf("%d",&n); for(int i=n;i>0;i/=10) { a=a*10+i%10;} if(n==a){printf("yes");} else {printf("no");} return 0; }

                    • 0
                      @ 2022-9-26 17:17:26

                      #include<stdio.h> bool hws(long int x) {

                      long int s, y=0;
                      s=x;
                      while(s>0)
                      {
                      	y=y*10+s%10;
                      	s=s/10;
                      	
                      }
                      if(y==x)
                      return true;
                      else
                      return false;
                      

                      } int main(){ long int n; scanf("%ld",&n); bool flag = hws(n); if(flag==0){ printf("no");}else{ printf("yes");} return 0;

                      }

                      • -2
                        @ 2022-10-21 20:00:20

                        #include<stdio.h> int main() { int j,n=0,X; scanf("%d",&X); j=X; while(j) { n=n*10+j%10; j/=10; } if(n==X) printf("yes"); else printf("no");

                        }

                        • 1

                        信息

                        ID
                        32
                        时间
                        1000ms
                        内存
                        128MiB
                        难度
                        6
                        标签
                        递交数
                        3522
                        已通过
                        1147
                        上传者