本文目錄一覽:
- 1、c語言題目
- 2、C語言輸入美元硬幣個數求總美元數
- 3、求c語言美元兌人民幣程序
- 4、C語言輸入美元金額,輸出兌換的人民幣金額
- 5、假設美元與人民幣匯率是1美元換8.27人民幣,編寫程序吧的金額,並輸出能兌換美元金額。
- 6、0.01 0.05 0.1 0.25 0.5 湊成一美元有多少種方式?C語言代碼怎麼寫?
c語言題目
#include stdio.h
int main()
{
float dollar;
printf(“請輸入美元金額:”);
scanf(“%f”,dollar);
printf(“%.2f 美元兌換人民幣 %.2f 元\n”, dollar,dollar*6.5573);
return 0;
}
C語言輸入美元硬幣個數求總美元數
#includestdio.h
void main()
{
int a,b,c,d,e,f,g;
printf(“輸入25美分的數量:”);
scanf(“%d”,a);
printf(“輸入10美分的數量:”);
scanf(“%d”,b);
printf(“輸入5美分的數量:”);
scanf(“%d”,c);
printf(“輸入1美分的數量:”);
scanf(“%d”,d);
e = 25*a + 10*b + 5*c + 1*d;
f = e/100;
g = e%100;
printf(“%d美元%d美分!”,f,g);
}
求c語言美元兌人民幣程序
#includestdio.h
#define fun(x) 6.177*(x)
int main(void)
{
int x;
double y;
scanf(“%d”,x);
y=fun(x);
printf(“%d 美元可兌換 人民幣 %.3lf 元\n”,x,y);
return 0;
}
C語言輸入美元金額,輸出兌換的人民幣金額
#includestdio.h
#define fun(x) 6.177*(x)
int main(void)
{
int x;
double y;
scanf(“%d”,x);
y=fun(x);
printf(“%d 美元可兌換 人民幣 %.3lf 元\n”,x,y);
return 0;
}
假設美元與人民幣匯率是1美元換8.27人民幣,編寫程序吧的金額,並輸出能兌換美元金額。
float rmb,dollars;scanf(“%f”,rmd);dollars=rmb/8.27;printf(“Dollars=%f,RMB=%f”,dollars,rmb);
0.01 0.05 0.1 0.25 0.5 湊成一美元有多少種方式?C語言代碼怎麼寫?
共有292種方案。
#include stdio.h
int main()
{int a,b,c,d,e,k=0;
printf(“0.01 0.05 0.1 0.25 0.5\n”);
for(a=0;a101;a++)
for(b=0;b21;b++)
for(c=0;c11;c++)
for(d=0;d5;d++)
for(e=0;e3;e++)
if(a+5*b+10*c+25*d+50*e==100)
{
printf(” %-6d%-6d%-6d%-6d%-6d\n”,a,b,c,d,e);
k++;
}
printf(“Total=%d\n”,k);
return 0;
}
原創文章,作者:IXSX,如若轉載,請註明出處:https://www.506064.com/zh-tw/n/144970.html