Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 92 Accepted Submission(s): 80
*------------*When the battery is 60% full, the interface will look like this:
|............|
|............|
|............|
|............|
|............|
|............|
|............|
|............|
|............|
|............|
*------------*
*------------*Each line there are 14 characters. Given the battery power the mobile phone left, say x%, your task is to output the corresponding interface. Here x will always be a multiple of 10, and never exceeds 100.
|............|
|............|
|............|
|............|
|------------|
|------------|
|------------|
|------------|
|------------|
|------------|
*------------*
1 #include<iostream> 2 #include<cstdio> 3 using namespace std; 4 int main() 5 { 6 int i,j,t,n,cnt; 7 scanf("%d",&t); 8 for(cnt=1;cnt<=t;cnt++) 9 { 10 scanf("%d",&n); 11 printf("Case #%d:\n",cnt); 12 for(i=0;i<12;i++) 13 { 14 for(j=0;j<14;j++) 15 { 16 if(i==0||i==11) 17 { 18 if(j==0||j==13) 19 printf("*"); 20 else 21 printf("-"); 22 } 23 else 24 if(j==0||j==13) 25 printf("|"); 26 else 27 if(i<=10-n/10) 28 printf("."); 29 else 30 printf("-"); 31 } 32 puts(""); 33 } 34 } 35 return 0; 36 }