2011百校联动“菜鸟杯”程序设计公开赛&&Bacon's Cipher

 水题,,,

#include<iostream>
#include<string>
#include<cstdio>
using namespace std;
int main()
{ int n;
 char a[10005];
  while(cin>>n)
  {  scanf("%s",a);
    int i=0;
	int sum=0;
	 while(i<n)
	 { 
	   if(a[i]<='9') sum+=16;
	   if(a[i+1]<='9') sum+=8;
	   if(a[i+2]<='9') sum+=4;
	   if(a[i+3]<='9') sum+=2;
	   if(a[i+4]<='9') sum+=1;
	   printf("%c",sum+65);
	   i+=5;
	   sum=0;
     }
	cout<<endl;
	}return 0;  
}


 

 

你可能感兴趣的:(2011百校联动“菜鸟杯”程序设计公开赛&&Bacon's Cipher)