#26419: 在我的電腦可以,但是上傳會CE


10931463@gafe.cksh.tp.edu.tw (凱廷陳)

學校 : 臺北市立成功高級中學
編號 : 156157
來源 : [61.64.7.78]
最後登入時間 :
2023-11-27 01:09:33
a022. 迴文 | From: [61.64.4.99] | 發表日期 : 2021-08-05 19:19

幫看一下哪裡錯

#include <iostream>

#include <cstdlib>

#include <string>

#include <cmath>

#include <math.h>

#include <stdio.h>

using namespace std;

int main()

{

   int c,i;

   char a[1000],b[1000];

   scanf("%s",a);

   c=strlen(a);

   for(i=0;i<c;i++){

    b[i]=a[c-i-1];

   }

   bool k=0;

   for(i=0;i<c;i++){

   if(b[i]!=a[i]){

   

   k=1;

   break;

   }

   }

   if(k==1)

   cout<<"no"<<endl;

   else

   cout<<"yes"<<endl;

   

   //system("pause");

   return 0;

}

 

 
#26420: Re:在我的電腦可以,但是上傳會CE


1234567weewee457@gmail.com (weewee4571234567)

學校 : 桃園市私立復旦高級中學
編號 : 92174
來源 : [114.43.44.160]
最後登入時間 :
2024-02-06 11:14:33
a022. 迴文 | From: [118.166.78.25] | 發表日期 : 2021-08-05 21:11

幫看一下哪裡錯

#include

#include

#include

#include

#include

#include

using namespace std;

int main()

{

   int c,i;

   char a[1000],b[1000];

   scanf("%s",a);

   c=strlen(a);

   for(i=0;i<c;i++){

    b[i]=a[c-i-1];

   }

   bool k=0;

   for(i=0;i<c;i++){

   if(b[i]!=a[i]){

   

   k=1;

   break;

   }

   }

   if(k==1)

   cout<<"no"<<endl;

   else

   cout<<"yes"<<endl;

   

   //system("pause");

   return 0;

}

 


為什麼要寫math.h跟stdio.h?

 
#26428: Re:在我的電腦可以,但是上傳會CE


cges30901 (cges30901)

學校 : 不指定學校
編號 : 30877
來源 : [101.136.203.77]
最後登入時間 :
2024-04-07 15:34:14
a022. 迴文 | From: [39.12.39.78] | 發表日期 : 2021-08-06 15:07

幫看一下哪裡錯

#include

#include

#include

#include

#include

#include

using namespace std;

int main()

{

   int c,i;

   char a[1000],b[1000];

   scanf("%s",a);

   c=strlen(a);

   for(i=0;i<c;i++){

    b[i]=a[c-i-1];

   }

   bool k=0;

   for(i=0;i<c;i++){

   if(b[i]!=a[i]){

   

   k=1;

   break;

   }

   }

   if(k==1)

   cout<<"no"<<endl;

   else

   cout<<"yes"<<endl;

   

   //system("pause");

   return 0;

}

 

要#include <cstring>

 
ZeroJudge Forum