新手c语言求代码纠错 求高人指点!

[复制链接]
查看11 | 回复4 | 2012-4-5 14:09:13 | 显示全部楼层 |阅读模式
#include void main(){int counter=1,i,largest,a[10];printf("enter ten numbers and i will tell you the largest:\n");//下面用for语句循环输入10个数for(i=0;i#include int main(){int counter=1, number1,number2, number3,largest;printf("enter ten number and i will tell you the large...
回复

使用道具 举报

千问 | 2012-4-5 14:09:13 | 显示全部楼层
代码很混乱,可读性差。比如counter这个变量的意义是什么?为什么取名叫counter呢?你比较的是10个数,都输入没有呢,你整个程序里面总共比较了3次,如何能得出10个数的最值呢?...
回复

使用道具 举报

千问 | 2012-4-5 14:09:13 | 显示全部楼层
这个不应该这样做 用循环语句和数组比较简单...
回复

使用道具 举报

千问 | 2012-4-5 14:09:13 | 显示全部楼层
这是单次的比较,而且你没有搞懂赋值与等于的区别!...
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行