#include <stdio.h>
int main()
{
int arrFirst[3] = {4,5,6};
int arrSecond[] = {7,2,9};
int arrThird[3];
arrThird[0]=10;
arrThird[1]=0;
arrThird[2]=12;
printf("%d\n", arrFirst[1]);
printf("%d\n",arrSecond[1]);
printf("%d\n", arrThird[1]);
return 0;
}
输出结果:520
int main()
{
int arrFirst[3] = {4,5,6};
int arrSecond[] = {7,2,9};
int arrThird[3];
arrThird[0]=10;
arrThird[1]=0;
arrThird[2]=12;
printf("%d\n", arrFirst[1]);
printf("%d\n",arrSecond[1]);
printf("%d\n", arrThird[1]);
return 0;
}
输出结果:520
#include <stdio.h>
int main()
{
int arrFirst[3] = {4,5,6};
int arrSecond[] = {7,2,9};
int arrThird[3];
arrThird[0]=10;
arrThird[1]=0;
arrThird[2]=12;
printf("%d\n", arrFirst[1]);
printf("%d\n",arrSecond[1]);
printf("%d\n", arrThird[1]);
return 0;
}
int main()
{
int arrFirst[3] = {4,5,6};
int arrSecond[] = {7,2,9};
int arrThird[3];
arrThird[0]=10;
arrThird[1]=0;
arrThird[2]=12;
printf("%d\n", arrFirst[1]);
printf("%d\n",arrSecond[1]);
printf("%d\n", arrThird[1]);
return 0;
}
#include <stdio.h>
int main()
{
int i, j, k;
for(i=1; i<5; i++)
{
for(j=3;j>=i;j--)
{
printf(" ");
}
for(k=1;k<2*i;k++)
{
printf("*");
}
printf("\n");
}
return 0;
}
int main()
{
int i, j, k;
for(i=1; i<5; i++)
{
for(j=3;j>=i;j--)
{
printf(" ");
}
for(k=1;k<2*i;k++)
{
printf("*");
}
printf("\n");
}
return 0;
}
2023-04-03
最赞回答 / 大哥布
//这是另一种解法:#include <stdio.h>float Price(int km,int H) //定义表示总价的函数,影响总价的变量有距离Km、上下班时间H1、H2。{ float cost; //定义总价变量,用来承载每次计算的结果。 if(km>3) { if(H>=23||H<5) //上、下班时间在晚间高收费区。 { cost=(km-3)*2.3*(1+0.2)...
2023-03-23