Code=ing
2013年11月10日 星期日
[UVA] 12602 - Nice Licence Plates
#include<stdio.h>
char s[10];
int main(){
int t,n,a,i;
scanf("%d",&t);
while(t--){
scanf("%s-%d",s,&n);
a=0;
for(i=0;s[i];i++)
a=a*26+s[i]-'A';
if(a-n<=100 && a-n>=-100) puts("nice");
else puts("not nice");
}
}
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言