-
数组的下标均以0开始查看全部
-
标识符不能是关键词,从a到z或A到Z或0到9查看全部
-
#include <stdio.h> int main() { //第一种形式 int arrFirst[3] = {1,2,3}; //第二种形式 int arrSecond[] = {1,2,3,}; //第三种形式 int arrThird[3]; arrThird[0]=1; arrThird[1]=2; arrThird[2]=3; //输出第一个数组中的第二个元素 printf("%d\n", arrFirst[1]); //输出第二个数组中的第二个元素 printf("d%\n", arrSecond[1]); //输出第三个数组中的第二个元素 printf("%d\n", arrThird[1]); return 0; }查看全部
-
#include <stdio.h> float getcarcost(int gotime,int distance) { float cost ,total; if(gotime<23&&gotime>5) { if(distance<=3) { cost= 0; } else { cost=(distance-3)*2.3; } } else { cost=(distance-1)*2.3*1.2; } total=cost+13+1; return total; } #include <stdio.h> float carcost(int gotime,int dis) { float money; if(dis<=3) { money=14; printf("车费为14元\n"); } else if(gotime>=23||gotime<5) { money=14+(dis-3)*2.3*1.2; printf("夜间打车费用为:%f\n",money); } else { money=14+(dis-3)*2.3; printf("日间间打车费用为:%f\n",money); } return money; } int main() { printf("打车费用%.1f",carcost(9,12)+carcost(18,12)); return 0; }查看全部
-
#include <stdio.h> float carcost(int gotime,int dis) { float money; if(dis<=3) { money=14; printf("车费为14元\n"); } else if(gotime>=23||gotime<5) { money=14+(dis-3)*2.3*1.2; printf("夜间打车费用为:%f\n",money); } else { money=14+(dis-3)*2.3; printf("日间间打车费用为:%f\n",money); } return money; } int main() { printf("打车费用%.1f",carcost(9,12)+carcost(18,12)); return 0; }查看全部
-
行为大袋子中的小袋子,列为小袋子中的苹果 第一行元素为10和20:指第一个袋子第一个元素为10 第二2个元素为20 arr[2][3]; 有两个小袋子,每个小袋子有3个元素,第一个小袋子中的三个元素是第一行,第二个小袋子中的三个元素是第二行。查看全部
-
qwq查看全部
-
%d 十进制整数 %c 单个字符 %s 字符串 %f 6位6位6位小数查看全部
-
注意注释的地方查看全部
-
#include <stdio.h> #define POCKETMONEY 10 //定义常量及常量值 int main() { /* POCKETMONEY = =10; 小明私自增加零花钱对吗?*/ printf("小明今天又得到%d元零花钱\n", POCKETMONEY); return 0; }查看全部
-
#define 标识符 常量 (标识符与常量之间不需要==)查看全部
-
重点,很重要。查看全部
-
y*=2。y=y2查看全部
-
...查看全部
-
标志符查看全部
举报
0/150
提交
取消