C语言中x*y怎么算?x=a+b.y=b+c. a=1 b=2. c=3

[复制链接]
查看11 | 回复5 | 2012-8-24 17:21:09 | 显示全部楼层 |阅读模式
#includeint main (void){int a=1,b=2,c=3;printf("x*y=%d\n",(a+b)*(b+c));return 0;} ...
回复

使用道具 举报

千问 | 2012-8-24 17:21:09 | 显示全部楼层
//是C++哦 用vc++ c-free turbo c Dev-c都可以#include using namespace std;main(){
const int a=1,b=2,c=3;//常量声明
int x=a+b,y=b+c;//变量声明
cout<<x<<endl<<...
回复

使用道具 举报

千问 | 2012-8-24 17:21:09 | 显示全部楼层
其实要是你是用自定义函数还是直接在主函数中书写,自定义函数会传参而已,而主函数直接定义...
回复

使用道具 举报

千问 | 2012-8-24 17:21:09 | 显示全部楼层
#include "stdio.h"int main (void){int a=1,b=2,c=3;int x,y,z;x = a+b;y = b+c;z = x*y;printf("%d", z);return 0;}...
回复

使用道具 举报

千问 | 2012-8-24 17:21:09 | 显示全部楼层
#include "stdio.h"void main(){
int a=1,b=2,c;
c=a*b;
printf("c=%d",a*b);}...
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行