最新回答 / qq_慕勒9479229
#include <stdio.h>int main() { int sale=90; //销售业绩为120万 int year=1; //刚刚进入公司1年 if(sale > 100) { if(year >= 2) { printf("%s\n","优秀员工奖"); } else { printf("%s\n","很遗憾,期望你再接再厉"); ...
2021-08-16
#include <stdio.h>
int main()
{
double num = 2.5; //定义浮点型变量num并赋值为2.5
int num1 = (int)num;
printf("num的整数部分是%f\n", num);
printf("num的整数部分是%d\n",num1);
return 0;
}
int main()
{
double num = 2.5; //定义浮点型变量num并赋值为2.5
int num1 = (int)num;
printf("num的整数部分是%f\n", num);
printf("num的整数部分是%d\n",num1);
return 0;
}
2021-08-15
最赞回答 / weixin_慕仰2568236
定义了数组和整型变量i,j之后,第一个for循环是把排序前的数组遍历出来,if语句作用是数组最后一个数后不要逗号的作用。第二个内嵌循环中第1个for循环作用是逐渐缩小比较范围,第2个for循环作用是通过(比较)和(赋值)把大的数放到当前范围的最后。最后一个循环作用是把排序后的数组遍历出来,if语句作用同第一个。不知道这样是不是你想要的答案?
2021-08-15
#include <stdio.h>
int main()
{
int score = 7200
if(score>=10000)
{printf("%s\n","钻石玩家");
}
else if (score>=5000) {
printf("%s\n","白金玩家");
}
else if (score>=1000) {
printf("%s\n","青铜玩家");
}
else
{
printf("%s\n","普通玩家");
}
return 0;
}
int main()
{
int score = 7200
if(score>=10000)
{printf("%s\n","钻石玩家");
}
else if (score>=5000) {
printf("%s\n","白金玩家");
}
else if (score>=1000) {
printf("%s\n","青铜玩家");
}
else
{
printf("%s\n","普通玩家");
}
return 0;
}
2021-08-14
int age = 15;
int height = 162;
float weight = 82.5;
char isfat = 'y';
printf("年龄:%d 岁\n", age);
printf("身高:%d CM\n", height);
printf("体重:%f KG\n", weight);
printf("是否属于肥胖儿童:%c\n", isfat);
int height = 162;
float weight = 82.5;
char isfat = 'y';
printf("年龄:%d 岁\n", age);
printf("身高:%d CM\n", height);
printf("体重:%f KG\n", weight);
printf("是否属于肥胖儿童:%c\n", isfat);
2021-08-14
最新回答 / 慕神5269880
https://www.qidian.com/soushu/%E ... 5%32%2E%38%62%63%6Ahttps://www.qidian.com/soushu/%E ... 6%AD%A5%32%2E%38%62https://www.oschina.net/search?i ... 5%32%2E%38%77%65%7Ahttps://www.qidian.com/soushu/%E ... 6%AD%A5%32%2E%38%62https://www.oschina.net/search?...
2021-08-14
最赞回答 / zb2014014146
这是属于前面自增自减的问题,num++是先取值,再运算。++num是先运算,再取值。所以前者最后是取到9再加1等于10循环结束,前者是先9加1等于10后再取值而10<=10还有一次循环先加到11再取值,最后不符合题目要求。所以一般这种问题都是++写在前面。
2021-08-13
#include <stdio.h>
int main()
{
int x = 0;
printf("x=%d\n",x++);
printf("x=%d\n",++x);
return 0;
}
int main()
{
int x = 0;
printf("x=%d\n",x++);
printf("x=%d\n",++x);
return 0;
}
2021-08-12
#include <stdio.h>
int main()
{
int x,y;
x = 10;
y = -3;
printf("x+y=%d\n", x+y );
printf("x-y=%d\n", x-y );
printf("x*y=%d\n", x*y );
printf("x/y=%d\n", x/y );
printf("x%%y=%d\n",x%y );
return 0;
}
int main()
{
int x,y;
x = 10;
y = -3;
printf("x+y=%d\n", x+y );
printf("x-y=%d\n", x-y );
printf("x*y=%d\n", x*y );
printf("x/y=%d\n", x/y );
printf("x%%y=%d\n",x%y );
return 0;
}
#include <stdio.h>
int main()
{
double num = 2.5; //定义浮点型变量num并赋值为2.5
int nus=(int)(num);
printf("num的整数部分是%d\n", nus);
return 0;
}
int main()
{
double num = 2.5; //定义浮点型变量num并赋值为2.5
int nus=(int)(num);
printf("num的整数部分是%d\n", nus);
return 0;
}
2021-08-12