初级c语言编程 为什么只能运行一次就结束了呢?若是多次运行怎么修改

[复制链接]
查看11 | 回复3 | 2013-10-16 10:01:32 | 显示全部楼层 |阅读模式
做成循环:#include main(){int yourage=1,hisage=1;while(yourage!=0){ printf("Please enter yourage:");scanf("%d",&yourage);printf("Please enter hisage:");scanf("%d",&hisage);if(yourage>=hisage){
printf("You are older!You age is%d\n",yourage);}else{
printf("He is older!His age is%d\n",hisage);}} }...
回复

使用道具 举报

千问 | 2013-10-16 10:01:32 | 显示全部楼层
#include main(){ int yourage,hisage;char flag ; while(){ printf("Please enter yourage:"); scanf("%d",&yourage); printf("Please enter hisage:"); scanf("%d...
回复

使用道具 举报

千问 | 2013-10-16 10:01:32 | 显示全部楼层
#include "stdio.h"#include "stdlib.h"void main(){int yourage,hisage;while(1){printf("Please enter yourage:");scanf("%d",&yourage);printf("Please enter hisage:");scanf("...
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行