字符串处理
AC代码:
#include <cstdio>
#include <cstring>
int main() {
int t,flag = 0;
scanf("%d", &t);
while(t--) {
int x;
scanf("%d", &x);
printf("Case #%d:\n", ++flag);
if(x==0) {
puts("*------------*");
for(int i=0; i<10; i++)
puts("|............|");
puts("*------------*");
}
else {
int p = x/10;
puts("*------------*");
for(int i=0; i<(10-p); i++) {
puts("|............|");
}
for(int i=0; i<p; i++) {
puts("|------------|");
}
puts("*------------*");
}
}
return 0;
}