herrDeng網內搜尋

自訂搜尋

Ads

2010年5月4日 星期二

C字串反轉

輸內字串如"1234567890"輸出為"0987654321"

39 則留言:

B9833162 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[100];
 char name2[100];
 gets(name);
 int x=strlen(name);
 for (int i=x-1; i>=0; i--)
 { 
 cout<<name[i];
 }
 cout<<endl;
 system("Pause");
 return 0;
}

B9833128 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[100];
 char name2[]="哈囉哈囉";
 gets(name);
 //puts(name);
 int x=strlen(name);
 //cout<<sizeof(name)<<endl;
 //cout<<x<<endl;
 for(int i=x-1;i>=0;i--)
  cout<<name[i];
 cout<<endl;
 //strcat(name,name2);
 //puts(name);
 //cout<<strlen(name)<<endl;
 system("pause");
 return 0;
}

B9833124 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[100];
 char name2[]="哈囉哈囉";
 gets(name);
 //puts(name);
 int x=strlen(name);
 //cout<<sizeof(name)<<endl;
 //cout<<x<<endl;
 for(int i=x-1;i>=0;i--)
  cout<<name[i];
 cout<<endl;
 //strcat(name,name2);
 //puts(name);
 //cout<<strlen(name)<<endl;
 system("pause");
 return 0;
}

B9833132 提到...

#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;
int main()
{
char name[100];
gets(name);
int x=strlen(name);
for (int i=x-1; i>=0; i--)
cout<<name[i];
cout<<endl;


puts(name);
cout<<strlen(name)<<endl;

system("Pause");
   return 0;
}

B9833157 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[]="1234567890";
 puts(name);
 int x=strlen(name);
 for (int i=x-1;i>=0;i--)
  cout<<name[i];
 cout<<"\n";
 system("pause");
 return 0;
}

B9833133 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[]="1234567890";
 puts(name);
 int x=strlen(name);
 for (int i=x-1;i>=0;i--)
  cout<<name[i];
 cout<<"\n";
 system("pause");
 return 0;
}

B9833125 提到...

b#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[]="1234567890";
 puts(name);
 int x=strlen(name);
 for (int i=x-1;i>=0;i--)
  cout<<name[i];
 cout<<"\n";
 system("pause");
 return 0;
}

B9833120 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[]="1234567890";
 puts(name);
 int x=strlen(name);
 for (int i=x-1;i>=0;i--)
  cout<<name[i];
 cout<<"\n";
 system("pause");
 return 0;
}

B9833173 提到...

#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;
int main()
{
char name[100];
gets(name);
int x=strlen(name);
for (int i=x-1; i>=0; i--)
cout<<name[i];
cout<<endl;


puts(name);
cout<<strlen(name)<<endl;

system("Pause");
   return 0;
}

B9833126 提到...

#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;
int main()
{
char name[100];
gets(name);
int x=strlen(name);
for (int i=x-1; i>=0; i--)
cout<<name[i];
cout<<endl;


puts(name);
cout<<strlen(name)<<endl;

system("Pause");
   return 0;
}

B9833130 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[]="1234567890";
 puts(name);
 int x=strlen(name);
 for (int i=x-1;i>=0;i--)
  cout<<name[i];
 cout<<"\n";
 system("pause");
 return 0;
}

B9833156 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[]="1234567890";
 puts(name);
 int x=strlen(name);
 for (int i=x-1;i>=0;i--)
  cout<<name[i];
 cout<<"\n";
 system("pause");
 return 0;
}

b9833160 提到...

#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;
int main()
{
char name[100];
gets(name);
int x=strlen(name);
for (int i=x-1; i>=0; i--)
cout<<name[i];
cout<<endl;


puts(name);
cout<<strlen(name)<<endl;

system("Pause");
   return 0;
}

b9833141 提到...

#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;
int main()
{
char name[100];
gets(name);
int x=strlen(name);
for (int i=x-1; i>=0; i--)
cout<<name[i];
cout<<endl;


puts(name);
cout<<strlen(name)<<endl;

system("Pause");
   return 0;
}

b833141 提到...

#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;
int main()
{
char name[100];
gets(name);
int x=strlen(name);
for (int i=x-1; i>=0; i--)
cout<<name[i];
cout<<endl;


puts(name);
cout<<strlen(name)<<endl;

system("Pause");
   return 0;
}

b9833122 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[100];
 char name2[]="狗尾續貂";
 gets(name);
// puts(name);
 int x=strlen(name);
// cout<<sizeof(name)<<endl;
// cout<<x<<endl;
 for (int i=x-1; i>=0; i--)
  cout<<name[i];
 cout<<endl;
// strcat(name, name2);
// puts(name);
// cout<<strlen(name)<<endl;
 system("pause");
 return 0;
}

b9833134 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[100];
 char name2[]="YOYOYO";
 gets(name);
// puts(name);
 int x=strlen(name);
// cout<<sizeof(name)<<endl;
// cout<<x<<endl;
 for (int i=x-1; i>=0; i--)
  cout<<name[i];
 cout<<endl;
// strcat(name, name2);
// puts(name);
// cout<<strlen(name)<<endl;
 system("pause");
 return 0;
}

B9833170 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[100];
 char name2[]="狗尾續貂";
 gets(name);
// puts(name);
 int x=strlen(name);
// cout<<sizeof(name)<<endl;
// cout<<x<<endl;
 for (int i=x-1; i>=0; i--)
  cout<<name[i];
 cout<<endl;
// strcat(name, name2);
// puts(name);
// cout<<strlen(name)<<endl;
 system("pause");
 return 0;
}

B9833140 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[100];
 char name2[]="狗尾續貂";
 gets(name);
// puts(name);
 int x=strlen(name);
// cout<<sizeof(name)<<endl;
// cout<<x<<endl;
 for (int i=x-1; i>=0; i--)
  cout<<name[i];
 cout<<endl;
// strcat(name, name2);
// puts(name);
// cout<<strlen(name)<<endl;
 system("pause");
 return 0;
}

b9833143 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[100];
 gets(name);
 int x=strlen(name);
for (int i=x-1;
  ; i--)
{
cout<<name[i];
}
cout<<endl;   
 system("Pause");
    return 0;
}

b9533053 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[100];
 
 gets(name);
 int x=strlen(name);
 for (int i=x-1; i>=0; i--)
 {
  cout<<name[i];
 }
    cout<<endl;
    system("Pause");
    return 0;

b9533031 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
    char name[100];
   
    gets (name);
    int x=strlen(name);
    for (int i=x-1;i>=0;i--)
    {
    cout<<name[i];
}
    cout<<endl;
    system("Pause");
    return 0;
}

B9633122 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[100];
 char name2[]="狗尾續貂";
 gets(name);
// puts(name);
 int x=strlen(name);
// cout<<sizeof(name)<<endl;
// cout<<x<<endl;
 for (int i=x-1; i>=0; i--)
  cout<<name[i];
 cout<<endl;
// strcat(name, name2);
// puts(name);
// cout<<strlen(name)<<endl;
 system("pause");
 return 0;
}

b9833127 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
    char name[]="1234567890";
    puts(name);
    int x=strlen(name);
    for (int i=x-1;i>=0;i--)
        cout<<name[i];
    cout<<"\n";
    system("pause");
    return 0;
}

B9833123 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[100];
 char name2[]="狗尾續貂";
 gets(name);
 //puts(name);
 int x =strlen(name);
 //cout<<sizeof(name)<<endl;
 //cout<<x<<endl;
 for (int i=x-1;i>=0;i--)
  cout<<name[i];
 cout<<endl;
 strcat(name,name2);
 //puts(name);
 //cout<<strlen(name)<<endl;
 system("pause");
 return 0;
}

B9833174 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
char name[100];
char name2[]="恭喜發財";
gets(name);
//puts(name);
int x=strlen(name);
//cout<<sizeof(name)<<endl;
//cout<<x<<endl;
for(int i=x-1;i>=0;i--)
cout<<name[i];
cout<<endl;
//strcat(name,name2);
//puts(name);
//cout<<strlen(name)<<endl;
system("pause");
return 0;
}

B9833153 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
char name[100];
gets(name);
int x=strlen(name);
for(int i=x-1;i>=0;i--)
cout<<name[i];
cout<<endl;
system("Pause");
return 0;
}

B9833145 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
char name[100];
char name2[]="不讓你睡";
gets(name);
//puts(name);
int x=strlen(name);
//cout<<sizeof(name)<<endl;
//cout<<x<<endl;
for(int i=x-1;i>=0;i--)
cout<<name[i];
cout<<endl;
//strcat(name,name2);
//puts(name);
//cout<<strlen(name)<<endl;
system("pause");
return 0;
}

B9833172 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
char name[100];
char name2[]="老師好帥";
gets(name);
//puts(name);
int x=strlen(name);
//cout<<sizeof(name)<<endl;
//cout<<x<<endl;
for(int i=x-1;i>=0;i--)
cout<<name[i];
cout<<endl;
//strcat(name,name2);
//puts(name);
//cout<<strlen(name)<<endl;
system("pause");
return 0;
}

b9533053 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[100];
 
 gets(name);
 int x=strlen(name);
 for (int i=x-1; i>=0; i--)
 {
  cout<<name[i];
 }
    cout<<endl;
    system("Pause");
    return 0;
}

B9833176 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
char name[100];
char name2[]="EA SPORT";
gets(name);
//puts(name);
int x=strlen(name);
//cout<<sizeof(name)<<endl;
//cout<<x<<endl;
for(int i=x-1;i>=0;i--)
cout<<name[i];
cout<<endl;
//strcat(name,name2);
//puts(name);
//cout<<strlen(name)<<endl;
system("pause");
return 0;
}

B9833121 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[100];
 char name2[]="狗尾續貂";
 gets(name);
 //puts(name);
 int x =strlen(name);
 //cout<<sizeof(name)<<endl;
 //cout<<x<<endl;
 for (int i=x-1;i>=0;i--)
  cout<<name[i];
 cout<<endl;
 strcat(name,name2);
 //puts(name);
 //cout<<strlen(name)<<endl;
 system("pause");
 return 0;
}

B9833167 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[100];
 char name2[]="狗尾續貂";
 gets(name);
 //puts(name);
 int x =strlen(name);
 //cout<<sizeof(name)<<endl;
 //cout<<x<<endl;
 for (int i=x-1;i>=0;i--)
  cout<<name[i];
 cout<<endl;
 strcat(name,name2);
 //puts(name);
 //cout<<strlen(name)<<endl;
 system("pause");
 return 0;
}

B9833152 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[100];
 char name2[]="狗尾續貂";
 gets(name);
 //puts(name);
 int x =strlen(name);
 //cout<<sizeof(name)<<endl;
 //cout<<x<<endl;
 for (int i=x-1;i>=0;i--)
  cout<<name[i];
 cout<<endl;
 strcat(name,name2);
 //puts(name);
 //cout<<strlen(name)<<endl;
 system("pause");
 return 0;
}

B9833155 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
char name[100];
gets(name);
int x=strlen(name);
for (int i=x-1; i>=0; i--)
cout<<name[i];
cout<<endl;
puts(name);
cout<<strlen(name)<<endl;
system("Pause");
return 0;
}

B9833171 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
char name[100];
char name2[]="鄭至華";
gets(name);
//puts(name);
int x=strlen(name);
//cout<<sizeof(name)<<endl;
//cout<<x<<endl;
for(int i=x-1;i>=0;i--)
cout<<name[i];
cout<<endl;
//strcat(name,name2);
//puts(name);
//cout<<strlen(name)<<endl;
system("pause");
return 0;

B9833161 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[10];
 gets(name);
 int x =strlen(name);
 for (int i=x-1;i>=0;i--)
  cout<<name[i];
 cout<<endl;
 strcat(name,name2);
 system("pause");
 return 0;
}

B9633183 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[100];
 char name2[100];
 gets(name);
 int x=strlen(name);
 for (int i=x-1; i>=0; i--)
 { 
 cout<<name[i];
 }
 cout<<endl;
 system("Pause");
 return 0;
}

B9633133 提到...

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
 char name[10];
 gets(name);
 int x =strlen(name);
 for (int i=x-1;i>=0;i--)
  cout<<name[i];
 cout<<endl;
 strcat(name,name2);
 system("pause");
 return 0;
}

Related Posts Plugin for WordPress, Blogger...

熱門文章