初学 c 有些不明白的 , 望解答 !先在此谢过! 也就是下面的求和程序

[复制链接]
查看11 | 回复1 | 2011-3-11 20:56:57 | 显示全部楼层 |阅读模式
写了这个
// chapter01.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int main(int argc, char* argv[])
{
int a;
int b;
int sum;
a=1;
b=1;
sum=a+b;
printf("sum is %d\n",sum);
return 0;
}
然后还写了
// chapter01.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int main(int argc, char* argv[])
{

int a;
int b;
int sum;
a=1;
b=2;
sum=a+b;
printf("sum is %d\n",sum);
return 0;
}
这两个粘到vc上是完全一样的但第一个错误求解
是不是上面因为空格的问题导致了错误? 那么在c中语言之间的间隔多少是不是比较重要?

回复

使用道具 举报

千问 | 2011-3-11 20:56:57 | 显示全部楼层
一看就是你标点符号有问题分号改成英文格式下的
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行