关于C语言的很简单的程序

来源:百度知道 编辑:UC知道 时间:2024/05/03 11:47:39
main<>
{
printf<"There is a C program"/n>;
}
系统说有一个错误
还麻烦各位讲讲怎么才知道错误在那里啊 看那里?
不对啊
我按ALT+F5怎么不执行哦
我保存了 也编译了啊(不过它弹出了个框 里面写 我的错误数为0 LINK数为4

晕 上面的程序没有一个正确啊 正确是这样的 .

#include<stdio.h>//因为使用了printf("");这个函数,所以包含stdio头文件

int main()
{
printf("There is a C program\n");
return 0;
}

to yohwan1230:

"考虑到printf和scanf函数使用频繁,系统允许在使用这两个函数时可不加#include命令."
(一看就知道你使用TC编译器,首先你要明白标准的程序可以不写#include<stdio.h>这个头文件就可以使用标准函数吗?问下你的老师.也可以用VC6.0编译器,编译下不要那个头文件看看行不行?(虽然VC6.0也不是很标准.但是最少比那个TC标准.)还有我们这是在编程工具,不是什么系统软件,关 系统什么事啊.)

"非void的函数类型都要求有返回值. " 标准的main() 要返回一个int 详细见 (http://post.baidu.com/f?kz=40624328) 为了安全起见 我补上一个return 0; 好 谢谢你的指教.

把<>换成()

main()
{
printf("There is a C program\n");
}

把<>换成() 既

main()
{
printf("There is a C program\n");
}

#include <iostream>
using namespace std;
in