Cell Phone signal time limit:3000/1000ms (java/other) Memory limit:65535/32768k (Java/other) total submission (s): Accepted Su Bmission (s): 9font:times New Roman | Verdana | Georgiafont Size:←→problem Description is now circulating on the market a simple mobile phone, on the phone with a 7x7 display to display cell phone signals, each block can display a character. When full signal is displayed as follows:
+-----+
|-4g|
|-----|
|-----|
|---- |
|-----|
+-----+
(Hangzhou electric Description block on the width of the setting is not uniform, the correct display please see the output sample)
Each signal (1≤I≤5) signal has a signal strength of 20%, which is not shown in the portion of the signal less than one cell. The current network transfer mode is also displayed in the upper-right corner. Display 4G when signal strength is not less than 90%, show 3g when signal is below 90%, not less than 60%; otherwise display E.
The 7x7 pixel pattern of the output signal for the given current signal strength d%.
Input inputs an integer d (0≤d≤100) representing the signal strength. Output does not output extra whitespace characters at the end of each line, as required by the topic. Sample Input
16T
Sample Output
+-----+| e| | | | | | | | | +-----+ +-----+|- 3g| | -- || --- || || | +-----+
This question is simple, the careful classification becomes;
1#include <iostream>//10052 using namespacestd;3 intMain () {4 intA;5 while(cin>>a) {6 intb=a/Ten;7cout<<"+-----+"<<Endl;8 if(b>=9){9cout<<"|-4g|"<<Endl;Ten}Else if(b>=6){ Onecout<<"|-3g|"<<Endl; A}Else if(b>=2){ -cout<<"|-e|"<<Endl; -}Else{ thecout<<"| e|"<<Endl; - } - if(b>=4) -cout<<"|-- |"<<Endl; + Else -cout<<"| |"<<Endl; + if(b>=6) Acout<<"|--- |"<<Endl; at Else -cout<<"| |"<<Endl; - if(b>=8) -cout<<"|---- |"<<Endl; - Else -cout<<"| |"<<Endl; in if(b==Ten) -cout<<"|-----|"<<Endl; to Else +cout<<"| |"<<Endl; -cout<<"+-----+"<<Endl; the } * $ return 0;Panax Notoginseng}
Cell Phone Signal