-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy path10082.cpp
More file actions
executable file
·33 lines (29 loc) · 791 Bytes
/
10082.cpp
File metadata and controls
executable file
·33 lines (29 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* Problem: WERTYU UVa 10082
Programmer: Md. Mahmud Ahsan
Compiled: Visual C++ 6.0
Date: 07-08-04
*/
#include <iostream>
using namespace std;
int main(){
/* store the code some rules [ \\ \' ] */
char string[] = "`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;\'ZXCVBNM,./";
char input[200];
int i, j;
int flag;
while (cin.getline(input, sizeof(input))){
for (i = 0; input[i] != '\0'; i++){
flag = 0; // chekc if other character that not in the code
for (j = 0; string[j] != '\0'; j++){
if (input[i] == string[j]){
cout << string[j-1]; // print the previous character
flag = 1; // if character found in the string code than say no
break;
}
}
if (flag == 0) cout << input[i];
}
cout << endl;
}
return 0;
}