注册 登录
编程论坛 C++教室

请各位大虾看看 这个哪里错了

deathknight 发布于 2008-10-22 22:54, 560 次点击
#include "string.h"
main( )
{char str[30];
int i,k=0;
scanf("%s",str);
for(i=0; str[i]!='\0';i++)
if(str[i]>=a&&str[i]<=z||str[i]>=A&&str[i]<=Z)
k++;
prinf("%d",k);}
4 回复
#2
blueboy820062008-10-22 22:56
warning C4013: 'scanf' undefined; assuming extern returning int
e:\study\c++\test for bccn\0810.c(7) : error C2065: 'a' : undeclared identifier
e:\study\c++\test for bccn\0810.c(7) : error C2065: 'z' : undeclared identifier
e:\study\c++\test for bccn\0810.c(7) : error C2065: 'A' : undeclared identifier
e:\study\c++\test for bccn\0810.c(7) : error C2065: 'Z' : undeclared identifier
e:\study\c++\test for bccn\0810.c(9) : warning C4013: 'prinf' undefined; assuming extern returning int
#3
deathknight2008-10-22 22:57
回复 2# blueboy82006 的帖子
啊 对哦  忘记了 谢谢LZ
#4
blueboy820062008-10-22 22:57
加#include<stdio.h>
字符都加个 单引号 ''...
#5
deathknight2008-10-22 23:20
回复 4# blueboy82006 的帖子
谢谢LZ的提醒  下次一定注意  再也不犯这种低级错误
1