首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

小弟我的初级加密程序如何老是出错?求解决办法!

2012-05-09 
我的初级加密程序怎么老是出错?求解决方法!!我写的将“How are you”进行十六进制加密,除了什么问题?老是出

我的初级加密程序怎么老是出错?求解决方法!!
我写的将“How are you”进行十六进制加密,除了什么问题?老是出现:
d:\hao1\hao1.cpp(22) : fatal error C1010: unexpected end of file while looking for precompiled header directive

程序如下:
#include <stdio.h>

int main(int argc, char* argv[])
{
char str[11];
int i;
printf("请输入加密数据\n");
for (i=1;i=11;i++)
{
scanf("%c",&str[i]);
(int) str[i];
n=str[i];
str[i]=n%16
printf("str[i]=%xH",str[i]);
}
return 0;
}

[解决办法]
是开启了预编译头吧?可以设置关闭的。
[解决办法]
#include <stdio.h>
#include <stdlib.h> 
#define SUM 100000
int main()
{
 float amount,aver,total;
 int i;
 for(i=1,total=0;1<=1000;i++)
 {
 printf("please enter amount:");
 scanf("%f",&amount);
 total=total+amount;
 if (total>=SUM) break;
 }
 aver=total/i;
 printf("num=%d\naver=%10.2f\n",i,aver);
 system("pause"); 
 return 0;
}
是这样的,就可以了

热点排行