update homework
This commit is contained in:
parent
e39f0a2cb6
commit
a454d8c40a
52
old_homework/homework_11.30.cpp
Normal file
52
old_homework/homework_11.30.cpp
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
#include<iostream> //字母位移
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
/*
|
||||||
|
int main(){
|
||||||
|
char CIN,COUT;
|
||||||
|
|
||||||
|
cin >> CIN;
|
||||||
|
|
||||||
|
int CIN2 = CIN+=3;
|
||||||
|
|
||||||
|
COUT = CIN2;
|
||||||
|
|
||||||
|
cout <<COUT;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
char letter;
|
||||||
|
int n = 3;
|
||||||
|
|
||||||
|
cin >>letter;
|
||||||
|
|
||||||
|
if (letter >= 'A' && letter <= 'Z') {
|
||||||
|
char new_letter = (letter - 'A' + n) % 26 + 'A';
|
||||||
|
cout << new_letter<<endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
char ch1,ch2;
|
||||||
|
|
||||||
|
int n = 3;
|
||||||
|
|
||||||
|
cin >>ch1;
|
||||||
|
ch2 = ((ch1 -65)+n) %26 +65;
|
||||||
|
|
||||||
|
cout <<ch2<<endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user