1012. Change Password, 1012 Change Password

Source: Internet
Author: User
Tags uppercase character

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 }

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.