这个程序的要求是将输入的一行字符以加密的形式输出,加密时,将每个字符的ASCII码依次反复加上4962873中的数字,并在32-122之间做模运算.程序我以上传,可是运行后却丝毫没反应,是哪里错了啊?
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;
typedef vector< vector<char> > mat;
int main()
{
cout<<"please input your character string"<<endl;
mat a;
string s;
getline(cin,s);
vector<char> c(7);
istringstream sin(s);
int n,ai;
loop: n=0;
c.clear;
for(;sin>>ai && n<7;)
{
c.push_back(ai);
n++;
}
a.push_back(c);
if(sin>>ai)
goto loop;
for(int i=0;i<a.size();i++)
{
a[i][0]+=4;
a[i][1]+=9;
a[i][2]+=6;
a[i][3]+=2;
a[i][4]+=8;
a[i][5]+=7;
a[i][6]+=3;
for(int j=0;j<a[i].size();j++)
{
if(a[i][j]>122)
a[i][j]=a[i][j]-122+32;
}
}
for(int m=0;m<a.size();m++)
{
for(int k=0;k<a[m].size();k++)
cout<<a[m][k]<<" ";
cout<<endl;
}
}