1012. Change Password, 1012 Change Password
1012. Change Password (Standard IO) Time Limit: 1000 MS space limit: 262144 KB Specific Limit
Description 1 Password conversion rules: a positive integer corresponds to one character. If the value of 123 of the digital model is in the range of to, the ASCII character is converted to the lower-case character corresponding to the remainder. If the password cannot be changed to lower-case characters, convert the remainder of the Number 91 to an uppercase character corresponding to the remainder if the remainder is in the range of-90. If the remainder cannot be changed to a lowercase character, convert it to "*". Enter a positive integer to output the converted characters. Enter a positive integer n (1 <=n <= 1000) to indicate the original password. Output the converted password. Sample Input
42
Sample output
*
Data range: 1 <= n <= 1000
1 #include<iostream> 2 #include<cmath> 3 #include<cstdio> 4 using namespace std; 5 int tot=0; 6 double ans; 7 int main() 8 { 9 int n;10 cin>>n;11 if(n%123>=97&&n%123<=122)12 {13 cout<<(char)(n%123);14 return 0;15 }16 else if(n%91>=65&&n%91<=90)17 {18 cout<<(char)(n%91);19 return 0;20 }21 else cout<<"*";22 return 0;23 }