| 记录编号 | 
        440420 | 
        评测结果 | 
        AAAAAAAAAA | 
    
    
        | 题目名称 | 
        1262.[NOIP 2012]Vigenère密码 | 
        最终得分 | 
        100 | 
            
    
    
        | 用户昵称 | 
         123 | 
        是否通过 | 
        通过 | 
    
    
        | 代码语言 | 
        C++ | 
        运行时间 | 
        0.004 s  | 
    
    
        | 提交时间 | 
        2017-08-23 08:47:19 | 
        内存使用 | 
        0.31 MiB  | 
        
    
    
    
    		显示代码纯文本
		
		#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
using namespace std;
string q,w;
int main(){
	freopen ("vigenere.in","r",stdin);
	freopen ("vigenere.out","w",stdout);
	int a,b,c,d;
	int i,j;
	cin>>q>>w;
	i=0;
	for(a=0;a<=w.length()-1;a++)
	{
		if(i>q.length()-1)
			i=0;
		if(q[i]>='A'&&q[i]<='Z')
			b=q[i]-'A';
		else
			b=q[i]-'a';
		if(w[a]>='A'&&w[a]<='Z')
			c=w[a]-'A';
		else
			c=w[a]-'a';
		if(b<=c)
			d=c-b;
		else
			d=(26-b)+c;
		if(w[a]>='A'&&w[a]<='Z')
			cout<<char('A'+d);
		else
			cout<<char('a'+d);
		i++;
	}
	return 0 ;
}