Дамп всех задач
This commit is contained in:
23
C++/строки/1.cpp
Normal file
23
C++/строки/1.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
#include <cctype>
|
||||
#include <cstdio>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
char s[80];
|
||||
cout <<"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n>";
|
||||
gets (s);
|
||||
int i=0;
|
||||
while (s[i]!='\0') {
|
||||
if (s[i]=='a') s[i]='b';
|
||||
else if (s[i]=='b') s[i]='a';
|
||||
if (s[i]=='A') s[i]='B';
|
||||
else if (s[i]=='B') s[i]='A';
|
||||
i++;
|
||||
}
|
||||
cout <<"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: "<<s<<endl;
|
||||
system ("pause");
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user