這是Herr Deng桑的教學blog,主要處理作業與班導事務,另外還有數位小品。
#include<iostream>#include<cstdlib>#include<string>#include<algorithm>using namespace std;string toUpper(string x){for (int i = 0; i < x.length(); i++) if ('a' <= x[i] && x[i] <= 'z') x[i] = (char)x[i] - 'a' + 'A'; return x;}string str_replace (string x, string y, string z){ int e; while ((e = x.find(y)) != -1) x.replace(e, y.length(), z); return x;}int main(){ string x = "d@414@gMI"; cout << "cipher=" << x << endl; x = str_replace(x, "@", "a"); cout << "cipher=" << x << endl; x = str_replace(x, "14", "這4"); cout << "cipher=" << x << endl; x = toUpper(x); cout << "cipher=" << x << endl; x = str_replace(x, "DA4", "不對"); cout << "cipher=" << x << endl; x = str_replace(x, "A", "個"); cout << "cipher=" << x << endl; x = str_replace(x, "GMI", "吉米"); cout << "cipher="<<x << endl; system("Pause"); return 0;}
#include <iostream>#include <cstdlib>#include <string>using namespace std;string toUpper(string x){ int n = x.length(); for (int i = 0; i < n; i++) if ('a' <= x[i] && x[i] <= 'z') x[i] = x[i] - 'a' + 'A'; return x;}string str_replace(string& x, string OLD, string NEW){ int pos; while ((pos = x.find(OLD)) != -1) x.replace(pos, OLD.length(), NEW); return x;}int main(){ string x; getline(cin, x); cout << x << endl; x = toUpper(x); cout << x << endl; x = str_replace(x, "AB", "就是"); cout << x << endl; x = str_replace(x, "ab", "不能有小寫"); cout << x << endl; system("pause"); return 0;}
#include <iostream>#include <cstdlib>#include <string>using namespace std;string toUpper(string x){ for (int i = 0; i < x.length(); i++){ if (x[i] >= 'a'&& x[i] <= 'z') x[i] = x[i] - 'a' + 'A'; } return x;}string str_replace(string x, string OLD, string NEW){ int pos; while ((pos = x.find(OLD)) != -1){ x = x.replace(pos, OLD.length(), NEW); } return x;}int main(){ string x = "d@414@gMI"; cout << x << endl; x = str_replace(x, "@", "a"); cout << x << endl; x = str_replace(x, "14", "這4"); cout << x << endl; x = toUpper(x); cout << x << endl; x = str_replace(x, "DA4", "不對"); cout << x << endl; x = str_replace(x, "A", "個"); cout << x << endl; x = str_replace(x, "GMI", "吉米"); cout << x << endl; system("pause"); return 0;}
#include <iostream>#include <cstdlib>#include <string>using namespace std;string toUpper(string x){ int n = x.length(); for (int i = 0; i < n; i++) if ('a' <= x[i] && x[i] <= 'z') x[i] = x[i] - 'a' + 'A'; return x;}string str_replace(string& x, string OLD, string NEW){ int pos; while ((pos = x.find(OLD)) != -1) x.replace(pos, OLD.length(), NEW); return x;}int main(){ string x; getline(cin, x); cout << x << endl; x = toUpper(x); cout << x << endl; x = str_replace(x, "AB", "就是"); cout << x << endl; x = str_replace(x, "ab", "不能有小寫"); cout << x << endl; system("pause"); return 0;}
#include <iostream>#include <cstdlib>#include <string>#include <cstring>using namespace std;string toUpper(string x){ for (int i = 0; i < x.length(); i++) { if (x[i] >= 'a' &&x[i] <= 'z') x[i] = x[i] - 'a' + 'A'; } return x;}string strReplace(string x, string Old, string New){ int pose; while ((pose = x.find(Old)) != -1) x.replace(pose,Old.length(),New); return x;}int main(){ string x; getline(cin, x); cout << x << endl; x = strReplace(x, "@", "a"); cout << x << endl; x = strReplace(x, "14", "這4"); cout << x << endl; x = toUpper(x); cout << x << endl; x = strReplace(x, "DA4", "不對"); cout << x << endl; x = strReplace(x, "A", "個"); cout << x << endl; x = strReplace(x, "GMI", "吉米"); cout << x << endl; system("Pause"); return 0;}
#include <iostream>#include <cstdlib>#include <string>#include <cstring>using namespace std;string toUpper(string x){ for (int i = 0; i < x.length(); i++){ if (x[i] >= 'a' && x[i] <= 'z') x[i] = (char)x[i] - 'a' + 'A'; } return x;}string str_replace(string x, string OLD, string NEW){ int pos; while ((pos = x.find(OLD)) != -1){ x = x.replace(pos, OLD.length(), NEW); } return x;}int main(){ string x; getline(cin, x); cout << x << endl; cout << x.length() << endl; x=str_replace(x, "@", "a"); cout << x << endl; cout << x.length() << endl; x = str_replace(x, "14", "這4"); cout << x << endl; cout << x.length() << endl; x = toUpper(x); cout << x << endl; cout << x.length() << endl; x = str_replace(x, "DA4", "不對"); cout << x << endl; cout << x.length() << endl; x = str_replace(x, "A", "個"); cout << x << endl; cout << x.length() << endl; x = str_replace(x, "GMI", "吉米"); cout << x << endl; cout << x.length() << endl; system("Pause"); return 0;}
#include<iostream>#include<cstdlib>#include<string>#include<cstring>using namespace std;string toUpper(string x){ for (int i = 0; i < x.length(); i++){ if (x[i] >= 'a'&& x[i] <= 'z') x[i] = x[i] - 'a' + 'A'; } return x;}string strReplace(string x, string Old, string New){ int pose; while ((pose = x.find(Old)) != -1) x.replace(pose, Old.length(),New); return x;}int main(){ string x; getline(cin, x); cout << x << endl; x = strReplace(x, "@", "a"); cout << x << endl; x = strReplace(x, "14", "這4"); cout << x << endl; x = toUpper(x); cout << x << endl; x = strReplace(x, "DA4", "不對"); cout << x << endl; x = strReplace(x, "A", "個"); cout << x << endl; x = strReplace(x, "GMI", "吉米"); cout << x << endl; system("Pause"); return 0;}
#include <iostream>#include <cstdlib>#include <string>#include <cstring>using namespace std;string toUpper(string x){ for (int i = 0; i < x.length(); i++){ if (x[i] >= 'a'&& x[i] <= 'z') x[i] = x[i] - 'a' + 'A'; } return x;}string str_replace(string x, string OLD, string NEW){ int pos; while ((pos = x.find(OLD)) != -1){ x = x.replace(pos, OLD.length(), NEW); } return x;}int main(){ string x; getline(cin, x); cout << x << endl; x = toUpper(x); cout << x << endl; cout << x.length() << endl; x = str_replace(x, "@", "a"); cout << x << endl; cout << x.length() << endl; x = str_replace(x, "14", "這4"); cout << x << endl; cout << x.length() << endl; x = toUpper(x); cout << x << endl; cout << x.length() << endl; x = str_replace(x, "DA4", "不對"); cout << x << endl; cout << x.length() << endl; x = str_replace(x, "A", "個"); cout << x << endl; cout << x.length() << endl; x = str_replace(x, "GMI", "吉米"); cout << x << endl; cout << x.length() << endl; system("Pause"); return 0;}
#include <iostream>#include <cstdlib>#include <string>#include <cstring>using namespace std;string toUpper(string x){ for (int i = 0; i < x.length(); i++){ if (x[i] >= 'a'&& x[i] <= 'z') x[i] = x[i] - 'a' + 'A'; } return x;}string str_replace(string x, string OLD, string NEW){ int pos; while ((pos = x.find(OLD)) != -1){ x = x.replace(pos, OLD.length(), NEW); } return x;}int main(){ string x; getline(cin, x); cout << x << endl; x = toUpper(x); cout << x << endl; cout << x.length() << endl; x = str_replace(x, "@", "a"); cout << x << endl; cout << x.length() << endl; x = str_replace(x, "14", "這4"); cout << x << endl; cout << x.length() << endl; x = toUpper(x); cout << x << endl; cout << x.length() << endl; x = str_replace(x, "DA4", "不對"); cout << x << endl; cout << x.length() << endl; x = str_replace(x, "A", "個"); cout << x << endl; cout << x.length() << endl; x = str_replace(x, "GMI", "吉米"); cout << x << endl; cout << x.length() << endl; system("Pause"); return 0;}
#include &lt;iostream&gt;#include &lt;cstdlib&gt;#include &lt;string&gt;#include &lt;cstring&gt;using namespace std;string toUpper(string x){ for (int i = 0; i &lt; x.length(); i++){ if (x[i] &gt;= 'a'&amp;&amp; x[i] &lt;= 'z') x[i] = x[i] - 'a' + 'A'; } return x;}string str_replace(string x, string OLD, string NEW){ int pos; while ((pos = x.find(OLD)) != -1){ x = x.replace(pos, OLD.length(), NEW); } return x;}int main(){ string x; getline(cin, x); cout &lt;&lt; x &lt;&lt; endl; x = toUpper(x); cout &lt;&lt; x &lt;&lt; endl; cout &lt;&lt; x.length() &lt;&lt; endl; x = str_replace(x, "@", "a"); cout &lt;&lt; x &lt;&lt; endl; cout &lt;&lt; x.length() &lt;&lt; endl; x = str_replace(x, "14", "&#36889;4"); cout &lt;&lt; x &lt;&lt; endl; cout &lt;&lt; x.length() &lt;&lt; endl; x = toUpper(x); cout &lt;&lt; x &lt;&lt; endl; cout &lt;&lt; x.length() &lt;&lt; endl; x = str_replace(x, "DA4", "&#19981;&#23565;"); cout &lt;&lt; x &lt;&lt; endl; cout &lt;&lt; x.length() &lt;&lt; endl; x = str_replace(x, "A", "&#20491;"); cout &lt;&lt; x &lt;&lt; endl; cout &lt;&lt; x.length() &lt;&lt; endl; x = str_replace(x, "GMI", "&#21513;&#31859;"); cout &lt;&lt; x &lt;&lt; endl; cout &lt;&lt; x.length() &lt;&lt; endl; system("Pause"); return 0;}
#include<iostream>#include<cstdlib>#include<string>#include<cstring>using namespace std;string toUpper(string x){ int n = x.length(); for (int i = 0; i < n; i++) if ('a' <= x[i] && x[i] <= 'z') x[i] = (char)x[i] - 'a' + 'A'; return x;}string strReplace(string x, string old, string New){ int pose; while ((pose = x.find(old)) != -1) x.replace(pose, old.length(), New); return x;}int main(){ string x; getline(cin, x); cout << x << endl; x = strReplace(x, "@", "a"); cout << x << endl; x = strReplace(x, "14", "這4"); cout << x << endl; x = toUpper(x); cout << x << endl; x = strReplace(x, "DA4", "不對"); cout << x << endl; x = strReplace(x, "A", "個"); cout << x << endl; x = strReplace(x, "GMI", "吉米"); cout << x << endl; system("Pause"); return 0;}
#include #include #include #include using namespace std;string toUpper(string x){for (int i = 0; i < x.length(); i++) {if (x[i] >= 'a' &&x[i] <= 'z')x[i] = x[i] - 'a' + 'A';}return x;}string strReplace(string x, string Old, string New){int pose;while ((pose = x.find(Old)) != -1)x.replace(pose,Old.length(),New);return x;}int main(){string x;getline(cin, x);cout << x << endl;x = strReplace(x, "@", "a");cout << x << endl;x = strReplace(x, "14", "這4");cout << x << endl;x = toUpper(x);cout << x << endl;x = strReplace(x, "DA4", "不對");cout << x << endl;x = strReplace(x, "A", "個");cout << x << endl;x = strReplace(x, "GMI", "吉米");cout << x << endl; system("Pause");return 0;}
B10233137#include#include#include#includeusing namespace std;string toUpper(string x){ for (int i = 0; i < x.length(); i++) if ('a' <= x[i] && x[i] <= 'z') x[i] = (char)x[i] - 'a' + 'A'; return x;}string str_replace(string x, string y, string z){ int e; while ((e = x.find(y)) != -1) x.replace(e, y.length(), z); return x;}int main(){ string x = "d@414@gMI"; cout << "cipher=" << x << endl; x = str_replace(x, "@", "a"); cout << "cipher=" << x << endl; x = str_replace(x, "14", "這4"); cout << "cipher=" << x << endl; x = toUpper(x); cout << "cipher=" << x << endl; x = str_replace(x, "DA4", "不對"); cout << "cipher=" << x << endl; x = str_replace(x, "A", "個"); cout << "cipher=" << x << endl; x = str_replace(x, "GMI", "吉米"); cout << "cipher=" << x << endl; system("Pause"); return 0;}
B10233127#include#include#include#includeusing namespace std;string toUpper(string x){ for (int i = 0; i < x.length(); i++) if ('a' <= x[i] && x[i] <= 'z') x[i] = (char)x[i] - 'a' + 'A'; return x;}string str_replace(string x, string y, string z){ int e; while ((e = x.find(y)) != -1) x.replace(e, y.length(), z); return x;}int main(){ string x = "d@414@gMI"; cout << "cipher=" << x << endl; x = str_replace(x, "@", "a"); cout << "cipher=" << x << endl; x = str_replace(x, "14", "這4"); cout << "cipher=" << x << endl; x = toUpper(x); cout << "cipher=" << x << endl; x = str_replace(x, "DA4", "不對"); cout << "cipher=" << x << endl; x = str_replace(x, "A", "個"); cout << "cipher=" << x << endl; x = str_replace(x, "GMI", "吉米"); cout << "cipher=" << x << endl; system("Pause"); return 0;}
#include #include #include #include using namespace std; string toUpper(string x){ int n = x.length(); for (int i = 0; i <n; i++) if ('a' <= x[i] && x[i] <= 'z') x[i] = (char)x[i] - 'a' + 'A'; return x; } string strReplace(string x, string old, string New){ int pose; while ((pose = x.find(old)) != -1) x.replace(pose, old.length(), New); return x; } int main() { string x; getline(cin ,x); cout << x << endl; x = toUpper(x); cout << x << endl; x = strReplace(x,"@", "A"); cout << x << endl; x = strReplace(x, "14", "這4"); cout << x << endl; x = strReplace(x, "DA4", "不對"); cout << x << endl; x = strReplace(x, "A", "個"); cout << x << endl; x = strReplace(x, "GMI", "吉米"); cout << x << endl; system("Pause"); return 0; }
#include<iostream>#include<cstdlib>#include<string>#include<algorithm>using namespace std;string toUpper(string x){ for (int i = 0; i < x.length(); i++) if ('a' <= x[i] && x[i] <= 'z') x[i] = (char)x[i] - 'a' + 'A'; return x;}string str_replace(string x, string y, string z){ int a; while ((a = x.find(y)) != -1) x.replace(a, y.length(), z); return x;}int main(){ string x = "d@414@gMI"; cout << "cipher=" << x << endl; x = str_replace(x, "@", "a"); cout << "cipher=" << x << endl; x = str_replace(x, "14", "這4"); cout << "cipher=" << x << endl; x = toUpper(x); cout << "cipher=" << x << endl; x = str_replace(x, "DA4", "不對"); cout << "cipher=" << x << endl; x = str_replace(x, "A", "個"); cout << "cipher=" << x << endl; x = str_replace(x, "GMI", "吉米"); cout << "cipher=" << x << endl; system("Pause"); return 0;}
#include<iostream>#include<cstdlib>#include<string>#include<algorithm>using namespace std;string toUpper(string x){for (int i = 0; i < x.length(); i++)if ('a' <= x[i] && x[i] <= 'z')x[i] = (char)x[i] - 'a' + 'A';return x;}string str_replace (string x, string y, string z){int e;while ((e = x.find(y)) != -1)x.replace(e, y.length(), z);return x;}int main(){string x = "d@414@gMI";cout << "cipher=" << x << endl;x = str_replace(x, "@", "a");cout << "cipher=" << x << endl;x = str_replace(x, "14", "這4");cout << "cipher=" << x << endl;x = toUpper(x);cout << "cipher=" << x << endl;x = str_replace(x, "DA4", "不對");cout << "cipher=" << x << endl;x = str_replace(x, "A", "個");cout << "cipher=" << x << endl;x = str_replace(x, "GMI", "吉米");cout << "cipher="<<x << endl;system("Pause");return 0;}
#include#include#include#includeusing namespace std;string toUpper(string x){for (int i = 0; i < x.length(); i++)if ('a' <= x[i] && x[i] <= 'z')x[i] = (char)x[i] - 'a' + 'A';return x;}string str_replace (string x, string y, string z){int e;while ((e = x.find(y)) != -1)x.replace(e, y.length(), z);return x;}int main(){string x = "d@414@gMI";cout << "cipher=" << x << endl;x = str_replace(x, "@", "a");cout << "cipher=" << x << endl;x = str_replace(x, "14", "這4");cout << "cipher=" << x << endl;x = toUpper(x);cout << "cipher=" << x << endl;x = str_replace(x, "DA4", "不對");cout << "cipher=" << x << endl;x = str_replace(x, "A", "個");cout << "cipher=" << x << endl;x = str_replace(x, "GMI", "吉米");cout << "cipher="<<x << endl;system("Pause");return 0;}
張貼留言
30 則留言:
#include<iostream>
#include<cstdlib>
#include<string>
#include<algorithm>
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++)
if ('a' <= x[i] && x[i] <= 'z')
x[i] = (char)x[i] - 'a' + 'A';
return x;
}
string str_replace (string x, string y, string z){
int e;
while ((e = x.find(y)) != -1)
x.replace(e, y.length(), z);
return x;
}
int main(){
string x = "d@414@gMI";
cout << "cipher=" << x << endl;
x = str_replace(x, "@", "a");
cout << "cipher=" << x << endl;
x = str_replace(x, "14", "這4");
cout << "cipher=" << x << endl;
x = toUpper(x);
cout << "cipher=" << x << endl;
x = str_replace(x, "DA4", "不對");
cout << "cipher=" << x << endl;
x = str_replace(x, "A", "個");
cout << "cipher=" << x << endl;
x = str_replace(x, "GMI", "吉米");
cout << "cipher="<<x << endl;
system("Pause");
return 0;
}
#include<iostream>
#include<cstdlib>
#include<string>
#include<algorithm>
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++)
if ('a' <= x[i] && x[i] <= 'z')
x[i] = (char)x[i] - 'a' + 'A';
return x;
}
string str_replace (string x, string y, string z){
int e;
while ((e = x.find(y)) != -1)
x.replace(e, y.length(), z);
return x;
}
int main(){
string x = "d@414@gMI";
cout << "cipher=" << x << endl;
x = str_replace(x, "@", "a");
cout << "cipher=" << x << endl;
x = str_replace(x, "14", "這4");
cout << "cipher=" << x << endl;
x = toUpper(x);
cout << "cipher=" << x << endl;
x = str_replace(x, "DA4", "不對");
cout << "cipher=" << x << endl;
x = str_replace(x, "A", "個");
cout << "cipher=" << x << endl;
x = str_replace(x, "GMI", "吉米");
cout << "cipher="<<x << endl;
system("Pause");
return 0;
}
#include<iostream>
#include<cstdlib>
#include<string>
#include<algorithm>
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++)
if ('a' <= x[i] && x[i] <= 'z')
x[i] = (char)x[i] - 'a' + 'A';
return x;
}
string str_replace (string x, string y, string z){
int e;
while ((e = x.find(y)) != -1)
x.replace(e, y.length(), z);
return x;
}
int main(){
string x = "d@414@gMI";
cout << "cipher=" << x << endl;
x = str_replace(x, "@", "a");
cout << "cipher=" << x << endl;
x = str_replace(x, "14", "這4");
cout << "cipher=" << x << endl;
x = toUpper(x);
cout << "cipher=" << x << endl;
x = str_replace(x, "DA4", "不對");
cout << "cipher=" << x << endl;
x = str_replace(x, "A", "個");
cout << "cipher=" << x << endl;
x = str_replace(x, "GMI", "吉米");
cout << "cipher="<<x << endl;
system("Pause");
return 0;
}
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
string toUpper(string x){
int n = x.length();
for (int i = 0; i < n; i++)
if ('a' <= x[i] && x[i] <= 'z')
x[i] = x[i] - 'a' + 'A';
return x;
}
string str_replace(string& x, string OLD, string NEW){
int pos;
while ((pos = x.find(OLD)) != -1)
x.replace(pos, OLD.length(), NEW);
return x;
}
int main(){
string x;
getline(cin, x);
cout << x << endl;
x = toUpper(x);
cout << x << endl;
x = str_replace(x, "AB", "就是");
cout << x << endl;
x = str_replace(x, "ab", "不能有小寫");
cout << x << endl;
system("pause");
return 0;
}
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++){
if (x[i] >= 'a'&& x[i] <= 'z')
x[i] = x[i] - 'a' + 'A';
}
return x;
}
string str_replace(string x, string OLD, string NEW){
int pos;
while ((pos = x.find(OLD)) != -1){
x = x.replace(pos, OLD.length(), NEW);
}
return x;
}
int main(){
string x = "d@414@gMI";
cout << x << endl;
x = str_replace(x, "@", "a");
cout << x << endl;
x = str_replace(x, "14", "這4");
cout << x << endl;
x = toUpper(x);
cout << x << endl;
x = str_replace(x, "DA4", "不對");
cout << x << endl;
x = str_replace(x, "A", "個");
cout << x << endl;
x = str_replace(x, "GMI", "吉米");
cout << x << endl;
system("pause");
return 0;
}
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
string toUpper(string x){
int n = x.length();
for (int i = 0; i < n; i++)
if ('a' <= x[i] && x[i] <= 'z')
x[i] = x[i] - 'a' + 'A';
return x;
}
string str_replace(string& x, string OLD, string NEW){
int pos;
while ((pos = x.find(OLD)) != -1)
x.replace(pos, OLD.length(), NEW);
return x;
}
int main(){
string x;
getline(cin, x);
cout << x << endl;
x = toUpper(x);
cout << x << endl;
x = str_replace(x, "AB", "就是");
cout << x << endl;
x = str_replace(x, "ab", "不能有小寫");
cout << x << endl;
system("pause");
return 0;
}
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++){
if (x[i] >= 'a'&& x[i] <= 'z')
x[i] = x[i] - 'a' + 'A';
}
return x;
}
string str_replace(string x, string OLD, string NEW){
int pos;
while ((pos = x.find(OLD)) != -1){
x = x.replace(pos, OLD.length(), NEW);
}
return x;
}
int main(){
string x = "d@414@gMI";
cout << x << endl;
x = str_replace(x, "@", "a");
cout << x << endl;
x = str_replace(x, "14", "這4");
cout << x << endl;
x = toUpper(x);
cout << x << endl;
x = str_replace(x, "DA4", "不對");
cout << x << endl;
x = str_replace(x, "A", "個");
cout << x << endl;
x = str_replace(x, "GMI", "吉米");
cout << x << endl;
system("pause");
return 0;
}
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++) {
if (x[i] >= 'a' &&x[i] <= 'z')
x[i] = x[i] - 'a' + 'A';
}
return x;
}
string strReplace(string x, string Old, string New){
int pose;
while ((pose = x.find(Old)) != -1)
x.replace(pose,Old.length(),New);
return x;
}
int main()
{
string x;
getline(cin, x);
cout << x << endl;
x = strReplace(x, "@", "a");
cout << x << endl;
x = strReplace(x, "14", "這4");
cout << x << endl;
x = toUpper(x);
cout << x << endl;
x = strReplace(x, "DA4", "不對");
cout << x << endl;
x = strReplace(x, "A", "個");
cout << x << endl;
x = strReplace(x, "GMI", "吉米");
cout << x << endl;
system("Pause");
return 0;
}
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++){
if (x[i] >= 'a' && x[i] <= 'z')
x[i] = (char)x[i] - 'a' + 'A';
}
return x;
}
string str_replace(string x, string OLD, string NEW){
int pos;
while ((pos = x.find(OLD)) != -1){
x = x.replace(pos, OLD.length(), NEW);
}
return x;
}
int main()
{
string x;
getline(cin, x);
cout << x << endl;
cout << x.length() << endl;
x=str_replace(x, "@", "a");
cout << x << endl;
cout << x.length() << endl;
x = str_replace(x, "14", "這4");
cout << x << endl;
cout << x.length() << endl;
x = toUpper(x);
cout << x << endl;
cout << x.length() << endl;
x = str_replace(x, "DA4", "不對");
cout << x << endl;
cout << x.length() << endl;
x = str_replace(x, "A", "個");
cout << x << endl;
cout << x.length() << endl;
x = str_replace(x, "GMI", "吉米");
cout << x << endl;
cout << x.length() << endl;
system("Pause");
return 0;
}
#include<iostream>
#include<cstdlib>
#include<string>
#include<cstring>
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++){
if (x[i] >= 'a'&& x[i] <= 'z')
x[i] = x[i] - 'a' + 'A';
}
return x;
}
string strReplace(string x, string Old, string New){
int pose;
while ((pose = x.find(Old)) != -1)
x.replace(pose, Old.length(),New);
return x;
}
int main()
{
string x;
getline(cin, x);
cout << x << endl;
x = strReplace(x, "@", "a");
cout << x << endl;
x = strReplace(x, "14", "這4");
cout << x << endl;
x = toUpper(x);
cout << x << endl;
x = strReplace(x, "DA4", "不對");
cout << x << endl;
x = strReplace(x, "A", "個");
cout << x << endl;
x = strReplace(x, "GMI", "吉米");
cout << x << endl;
system("Pause");
return 0;
}
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++){
if (x[i] >= 'a'&& x[i] <= 'z')
x[i] = x[i] - 'a' + 'A';
}
return x;
}
string str_replace(string x, string OLD, string NEW){
int pos;
while ((pos = x.find(OLD)) != -1){
x = x.replace(pos, OLD.length(), NEW);
}
return x;
}
int main()
{
string x;
getline(cin, x);
cout << x << endl;
x = toUpper(x);
cout << x << endl;
cout << x.length() << endl;
x = str_replace(x, "@", "a");
cout << x << endl;
cout << x.length() << endl;
x = str_replace(x, "14", "這4");
cout << x << endl;
cout << x.length() << endl;
x = toUpper(x);
cout << x << endl;
cout << x.length() << endl;
x = str_replace(x, "DA4", "不對");
cout << x << endl;
cout << x.length() << endl;
x = str_replace(x, "A", "個");
cout << x << endl;
cout << x.length() << endl;
x = str_replace(x, "GMI", "吉米");
cout << x << endl;
cout << x.length() << endl;
system("Pause");
return 0;
}
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++){
if (x[i] >= 'a'&& x[i] <= 'z')
x[i] = x[i] - 'a' + 'A';
}
return x;
}
string str_replace(string x, string OLD, string NEW){
int pos;
while ((pos = x.find(OLD)) != -1){
x = x.replace(pos, OLD.length(), NEW);
}
return x;
}
int main()
{
string x;
getline(cin, x);
cout << x << endl;
x = toUpper(x);
cout << x << endl;
cout << x.length() << endl;
x = str_replace(x, "@", "a");
cout << x << endl;
cout << x.length() << endl;
x = str_replace(x, "14", "這4");
cout << x << endl;
cout << x.length() << endl;
x = toUpper(x);
cout << x << endl;
cout << x.length() << endl;
x = str_replace(x, "DA4", "不對");
cout << x << endl;
cout << x.length() << endl;
x = str_replace(x, "A", "個");
cout << x << endl;
cout << x.length() << endl;
x = str_replace(x, "GMI", "吉米");
cout << x << endl;
cout << x.length() << endl;
system("Pause");
return 0;
}
#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
#include &lt;string&gt;
#include &lt;cstring&gt;
using namespace std;
string toUpper(string x){
for (int i = 0; i &lt; x.length(); i++){
if (x[i] &gt;= 'a'&amp;&amp; x[i] &lt;= 'z')
x[i] = x[i] - 'a' + 'A';
}
return x;
}
string str_replace(string x, string OLD, string NEW){
int pos;
while ((pos = x.find(OLD)) != -1){
x = x.replace(pos, OLD.length(), NEW);
}
return x;
}
int main()
{
string x;
getline(cin, x);
cout &lt;&lt; x &lt;&lt; endl;
x = toUpper(x);
cout &lt;&lt; x &lt;&lt; endl;
cout &lt;&lt; x.length() &lt;&lt; endl;
x = str_replace(x, "@", "a");
cout &lt;&lt; x &lt;&lt; endl;
cout &lt;&lt; x.length() &lt;&lt; endl;
x = str_replace(x, "14", "&#36889;4");
cout &lt;&lt; x &lt;&lt; endl;
cout &lt;&lt; x.length() &lt;&lt; endl;
x = toUpper(x);
cout &lt;&lt; x &lt;&lt; endl;
cout &lt;&lt; x.length() &lt;&lt; endl;
x = str_replace(x, "DA4", "&#19981;&#23565;");
cout &lt;&lt; x &lt;&lt; endl;
cout &lt;&lt; x.length() &lt;&lt; endl;
x = str_replace(x, "A", "&#20491;");
cout &lt;&lt; x &lt;&lt; endl;
cout &lt;&lt; x.length() &lt;&lt; endl;
x = str_replace(x, "GMI", "&#21513;&#31859;");
cout &lt;&lt; x &lt;&lt; endl;
cout &lt;&lt; x.length() &lt;&lt; endl;
system("Pause");
return 0;
}
#include<iostream>
#include<cstdlib>
#include<string>
#include<cstring>
using namespace std;
string toUpper(string x){
int n = x.length();
for (int i = 0; i < n; i++)
if ('a' <= x[i] && x[i] <= 'z')
x[i] = (char)x[i] - 'a' + 'A';
return x;
}
string strReplace(string x, string old, string New){
int pose;
while ((pose = x.find(old)) != -1)
x.replace(pose, old.length(), New);
return x;
}
int main()
{
string x;
getline(cin, x);
cout << x << endl;
x = strReplace(x, "@", "a");
cout << x << endl;
x = strReplace(x, "14", "這4");
cout << x << endl;
x = toUpper(x);
cout << x << endl;
x = strReplace(x, "DA4", "不對");
cout << x << endl;
x = strReplace(x, "A", "個");
cout << x << endl;
x = strReplace(x, "GMI", "吉米");
cout << x << endl;
system("Pause");
return 0;
}
#include
#include
#include
#include
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++) {
if (x[i] >= 'a' &&x[i] <= 'z')
x[i] = x[i] - 'a' + 'A';
}
return x;
}
string strReplace(string x, string Old, string New){
int pose;
while ((pose = x.find(Old)) != -1)
x.replace(pose,Old.length(),New);
return x;
}
int main()
{
string x;
getline(cin, x);
cout << x << endl;
x = strReplace(x, "@", "a");
cout << x << endl;
x = strReplace(x, "14", "這4");
cout << x << endl;
x = toUpper(x);
cout << x << endl;
x = strReplace(x, "DA4", "不對");
cout << x << endl;
x = strReplace(x, "A", "個");
cout << x << endl;
x = strReplace(x, "GMI", "吉米");
cout << x << endl;
system("Pause");
return 0;
}
#include
#include
#include
#include
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++) {
if (x[i] >= 'a' &&x[i] <= 'z')
x[i] = x[i] - 'a' + 'A';
}
return x;
}
string strReplace(string x, string Old, string New){
int pose;
while ((pose = x.find(Old)) != -1)
x.replace(pose,Old.length(),New);
return x;
}
int main()
{
string x;
getline(cin, x);
cout << x << endl;
x = strReplace(x, "@", "a");
cout << x << endl;
x = strReplace(x, "14", "這4");
cout << x << endl;
x = toUpper(x);
cout << x << endl;
x = strReplace(x, "DA4", "不對");
cout << x << endl;
x = strReplace(x, "A", "個");
cout << x << endl;
x = strReplace(x, "GMI", "吉米");
cout << x << endl;
system("Pause");
return 0;
}
#include
#include
#include
#include
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++) {
if (x[i] >= 'a' &&x[i] <= 'z')
x[i] = x[i] - 'a' + 'A';
}
return x;
}
string strReplace(string x, string Old, string New){
int pose;
while ((pose = x.find(Old)) != -1)
x.replace(pose,Old.length(),New);
return x;
}
int main()
{
string x;
getline(cin, x);
cout << x << endl;
x = strReplace(x, "@", "a");
cout << x << endl;
x = strReplace(x, "14", "這4");
cout << x << endl;
x = toUpper(x);
cout << x << endl;
x = strReplace(x, "DA4", "不對");
cout << x << endl;
x = strReplace(x, "A", "個");
cout << x << endl;
x = strReplace(x, "GMI", "吉米");
cout << x << endl;
system("Pause");
return 0;
}
#include
#include
#include
#include
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++) {
if (x[i] >= 'a' &&x[i] <= 'z')
x[i] = x[i] - 'a' + 'A';
}
return x;
}
string strReplace(string x, string Old, string New){
int pose;
while ((pose = x.find(Old)) != -1)
x.replace(pose,Old.length(),New);
return x;
}
int main()
{
string x;
getline(cin, x);
cout << x << endl;
x = strReplace(x, "@", "a");
cout << x << endl;
x = strReplace(x, "14", "這4");
cout << x << endl;
x = toUpper(x);
cout << x << endl;
x = strReplace(x, "DA4", "不對");
cout << x << endl;
x = strReplace(x, "A", "個");
cout << x << endl;
x = strReplace(x, "GMI", "吉米");
cout << x << endl;
system("Pause");
return 0;
}
#include
#include
#include
#include
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++) {
if (x[i] >= 'a' &&x[i] <= 'z')
x[i] = x[i] - 'a' + 'A';
}
return x;
}
string strReplace(string x, string Old, string New){
int pose;
while ((pose = x.find(Old)) != -1)
x.replace(pose,Old.length(),New);
return x;
}
int main()
{
string x;
getline(cin, x);
cout << x << endl;
x = strReplace(x, "@", "a");
cout << x << endl;
x = strReplace(x, "14", "這4");
cout << x << endl;
x = toUpper(x);
cout << x << endl;
x = strReplace(x, "DA4", "不對");
cout << x << endl;
x = strReplace(x, "A", "個");
cout << x << endl;
x = strReplace(x, "GMI", "吉米");
cout << x << endl;
system("Pause");
return 0;
}
#include
#include
#include
#include
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++) {
if (x[i] >= 'a' &&x[i] <= 'z')
x[i] = x[i] - 'a' + 'A';
}
return x;
}
string strReplace(string x, string Old, string New){
int pose;
while ((pose = x.find(Old)) != -1)
x.replace(pose,Old.length(),New);
return x;
}
int main()
{
string x;
getline(cin, x);
cout << x << endl;
x = strReplace(x, "@", "a");
cout << x << endl;
x = strReplace(x, "14", "這4");
cout << x << endl;
x = toUpper(x);
cout << x << endl;
x = strReplace(x, "DA4", "不對");
cout << x << endl;
x = strReplace(x, "A", "個");
cout << x << endl;
x = strReplace(x, "GMI", "吉米");
cout << x << endl;
system("Pause");
return 0;
}
#include
#include
#include
#include
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++) {
if (x[i] >= 'a' &&x[i] <= 'z')
x[i] = x[i] - 'a' + 'A';
}
return x;
}
string strReplace(string x, string Old, string New){
int pose;
while ((pose = x.find(Old)) != -1)
x.replace(pose,Old.length(),New);
return x;
}
int main()
{
string x;
getline(cin, x);
cout << x << endl;
x = strReplace(x, "@", "a");
cout << x << endl;
x = strReplace(x, "14", "這4");
cout << x << endl;
x = toUpper(x);
cout << x << endl;
x = strReplace(x, "DA4", "不對");
cout << x << endl;
x = strReplace(x, "A", "個");
cout << x << endl;
x = strReplace(x, "GMI", "吉米");
cout << x << endl;
system("Pause");
return 0;
}
B10233137
#include
#include
#include
#include
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++)
if ('a' <= x[i] && x[i] <= 'z')
x[i] = (char)x[i] - 'a' + 'A';
return x;
}
string str_replace(string x, string y, string z){
int e;
while ((e = x.find(y)) != -1)
x.replace(e, y.length(), z);
return x;
}
int main(){
string x = "d@414@gMI";
cout << "cipher=" << x << endl;
x = str_replace(x, "@", "a");
cout << "cipher=" << x << endl;
x = str_replace(x, "14", "這4");
cout << "cipher=" << x << endl;
x = toUpper(x);
cout << "cipher=" << x << endl;
x = str_replace(x, "DA4", "不對");
cout << "cipher=" << x << endl;
x = str_replace(x, "A", "個");
cout << "cipher=" << x << endl;
x = str_replace(x, "GMI", "吉米");
cout << "cipher=" << x << endl;
system("Pause");
return 0;
}
B10233137
#include
#include
#include
#include
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++)
if ('a' <= x[i] && x[i] <= 'z')
x[i] = (char)x[i] - 'a' + 'A';
return x;
}
string str_replace(string x, string y, string z){
int e;
while ((e = x.find(y)) != -1)
x.replace(e, y.length(), z);
return x;
}
int main(){
string x = "d@414@gMI";
cout << "cipher=" << x << endl;
x = str_replace(x, "@", "a");
cout << "cipher=" << x << endl;
x = str_replace(x, "14", "這4");
cout << "cipher=" << x << endl;
x = toUpper(x);
cout << "cipher=" << x << endl;
x = str_replace(x, "DA4", "不對");
cout << "cipher=" << x << endl;
x = str_replace(x, "A", "個");
cout << "cipher=" << x << endl;
x = str_replace(x, "GMI", "吉米");
cout << "cipher=" << x << endl;
system("Pause");
return 0;
}
B10233127
#include
#include
#include
#include
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++)
if ('a' <= x[i] && x[i] <= 'z')
x[i] = (char)x[i] - 'a' + 'A';
return x;
}
string str_replace(string x, string y, string z){
int e;
while ((e = x.find(y)) != -1)
x.replace(e, y.length(), z);
return x;
}
int main(){
string x = "d@414@gMI";
cout << "cipher=" << x << endl;
x = str_replace(x, "@", "a");
cout << "cipher=" << x << endl;
x = str_replace(x, "14", "這4");
cout << "cipher=" << x << endl;
x = toUpper(x);
cout << "cipher=" << x << endl;
x = str_replace(x, "DA4", "不對");
cout << "cipher=" << x << endl;
x = str_replace(x, "A", "個");
cout << "cipher=" << x << endl;
x = str_replace(x, "GMI", "吉米");
cout << "cipher=" << x << endl;
system("Pause");
return 0;
}
#include #include #include #include using namespace std; string toUpper(string x){ int n = x.length(); for (int i = 0; i <n; i++) if ('a' <= x[i] && x[i] <= 'z') x[i] = (char)x[i] - 'a' + 'A'; return x; } string strReplace(string x, string old, string New){ int pose; while ((pose = x.find(old)) != -1) x.replace(pose, old.length(), New); return x; } int main() { string x; getline(cin ,x); cout << x << endl; x = toUpper(x); cout << x << endl; x = strReplace(x,"@", "A"); cout << x << endl; x = strReplace(x, "14", "這4"); cout << x << endl; x = strReplace(x, "DA4", "不對"); cout << x << endl; x = strReplace(x, "A", "個"); cout << x << endl; x = strReplace(x, "GMI", "吉米"); cout << x << endl; system("Pause"); return 0; }
#include
#include
#include
#include
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++) {
if (x[i] >= 'a' &&x[i] <= 'z')
x[i] = x[i] - 'a' + 'A';
}
return x;
}
string strReplace(string x, string Old, string New){
int pose;
while ((pose = x.find(Old)) != -1)
x.replace(pose,Old.length(),New);
return x;
}
int main()
{
string x;
getline(cin, x);
cout << x << endl;
x = strReplace(x, "@", "a");
cout << x << endl;
x = strReplace(x, "14", "這4");
cout << x << endl;
x = toUpper(x);
cout << x << endl;
x = strReplace(x, "DA4", "不對");
cout << x << endl;
x = strReplace(x, "A", "個");
cout << x << endl;
x = strReplace(x, "GMI", "吉米");
cout << x << endl;
system("Pause");
return 0;
}
#include
#include
#include
#include
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++) {
if (x[i] >= 'a' &&x[i] <= 'z')
x[i] = x[i] - 'a' + 'A';
}
return x;
}
string strReplace(string x, string Old, string New){
int pose;
while ((pose = x.find(Old)) != -1)
x.replace(pose,Old.length(),New);
return x;
}
int main()
{
string x;
getline(cin, x);
cout << x << endl;
x = strReplace(x, "@", "a");
cout << x << endl;
x = strReplace(x, "14", "這4");
cout << x << endl;
x = toUpper(x);
cout << x << endl;
x = strReplace(x, "DA4", "不對");
cout << x << endl;
x = strReplace(x, "A", "個");
cout << x << endl;
x = strReplace(x, "GMI", "吉米");
cout << x << endl;
system("Pause");
return 0;
}
#include<iostream>
#include<cstdlib>
#include<string>
#include<algorithm>
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++)
if ('a' <= x[i] && x[i] <= 'z')
x[i] = (char)x[i] - 'a' + 'A';
return x;
}
string str_replace(string x, string y, string z){
int a;
while ((a = x.find(y)) != -1)
x.replace(a, y.length(), z);
return x;
}
int main(){
string x = "d@414@gMI";
cout << "cipher=" << x << endl;
x = str_replace(x, "@", "a");
cout << "cipher=" << x << endl;
x = str_replace(x, "14", "這4");
cout << "cipher=" << x << endl;
x = toUpper(x);
cout << "cipher=" << x << endl;
x = str_replace(x, "DA4", "不對");
cout << "cipher=" << x << endl;
x = str_replace(x, "A", "個");
cout << "cipher=" << x << endl;
x = str_replace(x, "GMI", "吉米");
cout << "cipher=" << x << endl;
system("Pause");
return 0;
}
#include<iostream>
#include<cstdlib>
#include<string>
#include<algorithm>
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++)
if ('a' <= x[i] && x[i] <= 'z')
x[i] = (char)x[i] - 'a' + 'A';
return x;
}
string str_replace (string x, string y, string z){
int e;
while ((e = x.find(y)) != -1)
x.replace(e, y.length(), z);
return x;
}
int main(){
string x = "d@414@gMI";
cout << "cipher=" << x << endl;
x = str_replace(x, "@", "a");
cout << "cipher=" << x << endl;
x = str_replace(x, "14", "這4");
cout << "cipher=" << x << endl;
x = toUpper(x);
cout << "cipher=" << x << endl;
x = str_replace(x, "DA4", "不對");
cout << "cipher=" << x << endl;
x = str_replace(x, "A", "個");
cout << "cipher=" << x << endl;
x = str_replace(x, "GMI", "吉米");
cout << "cipher="<<x << endl;
system("Pause");
return 0;
}
#include
#include
#include
#include
using namespace std;
string toUpper(string x){
for (int i = 0; i < x.length(); i++)
if ('a' <= x[i] && x[i] <= 'z')
x[i] = (char)x[i] - 'a' + 'A';
return x;
}
string str_replace (string x, string y, string z){
int e;
while ((e = x.find(y)) != -1)
x.replace(e, y.length(), z);
return x;
}
int main(){
string x = "d@414@gMI";
cout << "cipher=" << x << endl;
x = str_replace(x, "@", "a");
cout << "cipher=" << x << endl;
x = str_replace(x, "14", "這4");
cout << "cipher=" << x << endl;
x = toUpper(x);
cout << "cipher=" << x << endl;
x = str_replace(x, "DA4", "不對");
cout << "cipher=" << x << endl;
x = str_replace(x, "A", "個");
cout << "cipher=" << x << endl;
x = str_replace(x, "GMI", "吉米");
cout << "cipher="<<x << endl;
system("Pause");
return 0;
}
張貼留言