Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
62425 | 万正钰 | 变换字符串 | C++ | Accepted | 1 MS | 268 KB | 554 | 2023-12-23 17:11:57 |
#include<algorithm> #include<iostream> #include<cstring> #include<cmath> #include<iomanip> using namespace std; int main(){ char s1[31],s2[31],s3[31]; char *p1,*p2,*p3; cin.getline(s1,31); for(p1=s1,p2=s2,p3=s3;*p1!='\0';p1++,p2++,p3++) *p2=*p1,*p3=*p1; *p2='\0',*p3='\0'; for(p2=s2;*p2!='\0';p2++){ if(*p2>='a' && *p2<='z') *p2=' '; } for(p3=s3;*p3!='\0';p3++){ if(*p3>='A' && *p3<='Z') *p3=' '; } cout<<s1<<endl<<s3<<endl<<s2; return 0; }