gpt4 book ai didi

需要 C 项目帮助

转载 作者:太空宇宙 更新时间:2023-11-04 06:14:55 27 4
gpt4 key购买 nike

<分区>

我是编码新手,我正在通过一本名为“The C Programming Language - 2nd Edition - Ritchie Kernighan”的书学习,并且有以下代码:

#include<stdio.h>
#include<stdlib.h>
int main(){
int c,nl;
nl =0;
while((c=getchar())!=EOF)
if(c == '\n')
++nl;
printf("%d\n",nl);
return 0;
}

在 CodeBlocks 中输入代码后,我运行它,当我输入一个词并按下回车键时,没有任何反应。这个词没有被统计和打印。我对这一切都不熟悉,但如果有人有想法,请随时分享。非常感谢!

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com