标签:style blog io color ar os for sp strong
描述
给定一行字符,逆序输出此行(空格.数字不输出)
3 abc 123de abc 123 abc d
edcba cba dcba
#include <iostream> #include <string.h> using namespace std; int main() { int n; cin>>n; char a[41]; char b[41]; int m1,m2; while(n--) { cin>>a; cin>>b; m1 = strlen(a); m2 = strlen(b); for(int j=m2-1;j>=0;j--){ if(b[j]>=‘A‘ && b[j] <=‘z‘) cout<<b[j]; } for(int i=m1-1;i>=0;i--){ if(a[i]>=‘A‘ && a[i] <=‘z‘) cout<<a[i]; } cout<<endl; } return 0; }
标签:style blog io color ar os for sp strong
原文地址:http://www.cnblogs.com/imwtr/p/4069554.html