最赞回答 / 慕粉sjtu
const为常量值,define为字符串替换。1.const在编译阶段使用;define在预编译阶段使用。2.const有数据类型,做安全检查;define无类型,不做安全检查。3.const可以调试;define不能调试。4.const占用一份内存;define不占用内存,但是会多处进行字符串替换
2017-10-22
最新回答 / 清风与岚
#include <stdio.h>int main(){ //定义三位数num,个位数sd,十位数td,百位数hd int num, sd, td, hd; //循环所有三位数 for( num=100 ; num<500 ; num++ ) { //获取三位数字num百位上的数字 hd = num/100 ; //获取三位数字num十位上的数字 td ...
2017-10-22
最新回答 / 鲮凡
#include<stdio.h>int main(){ float a, c ; int b; printf("请输入一个实数和一个整数:\n"); scanf("%f%d",a,b); c=a/b; printf("输出%.3f",c); return 0;}
2017-10-21
最新回答 / qq_慕工程1148236
if(score>=10000){printf("钻石玩家");}else if(score>=5000&&score<10000){printf("铂金玩家"):}else if(score>=1000&&score<5000){printf("青铜玩家");}else {printf("普通玩家");}你的分数范围错了当然输出错的,你只写下限 没写上限啊
2017-10-20
最新回答 / 凉杏
#include <stdio.h>int main(){ int sum = 0; int i; for(i=1; i<=10; i++) { printf("%d\n", i); if(i==3) //是不是少了一个判断呢? goto LOOP; //在这里使用goto语句 } LOOP:printf("结束for循环了....")...
2017-10-20