新手求解惑

[复制链接]
查看11 | 回复3 | 2011-1-30 14:55:40 | 显示全部楼层 |阅读模式
呵呵,问题很简单我给你修改下,正确的程序如下:#include int answers() //声明去掉类型int main(){ int sum=0; sum=answers(); //这里不需要传入形参了 cout>a>>b; sum=a+b; return sum;}...
回复

使用道具 举报

千问 | 2011-1-30 14:55:40 | 显示全部楼层
#include int answers();//1.中文分号。2.函数声明类型不匹配int main(){ int sum=0; sum=answers(sum); cout<<"\n 这两个数相加的结果为\n"<<sum; return 0;}int answers(){ int s...
回复

使用道具 举报

千问 | 2011-1-30 14:55:40 | 显示全部楼层
#include int answers()//这是什么???函数??int main(){ int sum; sum=answer(sum);//这是什么?是函数?这个函数有参数,为什么上个没有?? cout<<"\n 这两个数相加的结果为\n"<<sum; return 0;}大致改一下...
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行