为什么程序输出不了,总提示有错误呢?都是戏错误
万耀丹 正式会员 2015-06-14 09:56:01
2699 3 0

// try1.cpp : Defines the entry point for the console application.
//

#include<stdio.h>

for(i=1;i<=100;i++)
{ printf("%8d\n",i);
if(i%5==o)
printf("\n");

}

------------------Configuration: try1 - Win32 Debug--------------------
Compiling...
try1.cpp
d:\microsoft visual studio\myprojects\try1\try1.cpp(13) : fatal error C1010: unexpected end of file while looking for precompiled header directive
执行 cl.exe 时出错.

try1.exe - 1 error(s), 0 warning(s)

问题来自: for循环实例

共 3 个回答

    祁老师 人气红星 3244天前

    同学 所有的程序都需要有一个main  你这边没有  变量在使用之前需要定义 你这边也没有定义 

    万耀丹 正式会员 3241天前

    回复 祁老师:就加个main函数?怎么改

    祁老师 人气红星 3240天前

    回复 万耀丹 :程序第一课就开始讲怎么去编程。  每个程序都需要有一个main函数

    #include <stdio.h>

    main()

    int i;

    for(i=1;i<=100;i++)

    {

    printf("%8d\n",i);

    if(i%5==0)

    printf("\n");

    }

    }


您还没有登录,所以不能回复该问题
我要回复

  • 0

    点赞

  • 扫一扫分享朋友圈

    二维码

  • 分享

相关问题