當前位置:首頁 » 編程語言 » c語言套裝

c語言套裝

發布時間: 2023-01-31 03:37:10

Ⅰ 學c語言現在最好用的編程軟體

Turbo C就可以的。編輯文本的時候可以用utraledit
至於vc++之類的我是不推薦初學者使用的

Ⅱ C語言編程,題目:周末商場促銷,某品牌服裝即可以買套裝,又可以買單件,若買的不少於50套,每套80

#include<stdio.h>
int Get(int count)
{
if(count>=50)
return count*80;
else
return count*90;
}
int Pay(int shangyi,int kuzi)
{
int gold=0;
int left=0;

if(shangyi==kuzi)
gold=Get(shangyi);
else if(shangyi>kuzi)
{
gold=Get(kuzi);
left=shangyi-kuzi;
gold+=left*60;
}
else if(shangyi<kuzi)
{
gold=Get(shangyi);
left=kuzi-shangyi;
gold+=left*45;
}
return gold;
}
int main()
{
int shangyi=55;
int kuzi=50;
int gold=Pay(shangyi,kuzi);
printf("%d ",gold);

system("pause");
}

Ⅲ C語言問題某服裝店經營3款套裝,成套出售和單間出售均可。

/*不是奔著分來的,只是興趣。。。。
沒有仔細測,如果有問題,請留言

例子:輸入3487
*/
#include<stdio.h>

#defineN2
#defineM3

intmain(){
intsy,kz;
inttc[M][N]={{1},{2},{3}};
inttc1,tc2,tc3;
printf("請輸入所買上衣和褲子的件數:");
scanf("%d%d",&sy,&kz);
tc[0][1]=getPrice(kz,sy,50,80,90,60,45);
tc[1][1]=getPrice(kz,sy,45,82,87,65,35);
tc[2][1]=getPrice(kz,sy,100,75,95,65,45);

intx,i=0,j,k,t;
//數組排序:
for(x=0;x<M-1;x++)
{

if(tc[x][1]>tc[x+1][1])
{
t=tc[x+1][1];
tc[x+1][1]=tc[x][1];
tc[x][1]=t;

t=tc[x+1][0];
tc[x+1][0]=tc[x][0];
tc[x][0]=t;
}

if(x==M-2&&i<M-2){
x=-1;
i++;
}

}
for(x=0;x<M;x++)
{
printf("款式%d:%d元 ",tc[x][0],tc[x][1]);
}
return0;
}


intgetPrice(intkz,intsy,int_t,intupPrice,intlowPrice,intsyPrice,intkzPrice){
intprice=0;
if(kz==0)
price=sy*syPrice;
elseif(sy==0)
price=kz*kzPrice;
else
{
intt=kz>sy?sy:kz;
if(t>=_t)
price=t*upPrice+(kz-t)*kzPrice+(sy-t)*syPrice;
else
price=t*lowPrice+(kz-t)*kzPrice+(sy-t)*syPrice;
}
returnprice;
}

Ⅳ c語言編程 某服裝批發商店經營套裝,也單價出售,若買的不少於50套,每套80元,不足50套每套10

#include "stdio.h"

int main(void)
{
int imoney = 0;
int iWaist = 0;
int itrousers = 0;
printf("請分別輸入需要買的上衣和褲子的數目:");
scanf("%d%d" ,&iWaist ,&itrousers);//可以加上對輸入數值的正確性的判斷
if ( iWaist >= itrousers )
{
if ( itrousers >= 50 )
{
imoney = itrousers * 80 + ( iWaist - itrousers )*60;
}
else
{
imoney = itrousers * 100 + ( iWaist - itrousers )*60;
}
}
else
{
if ( iWaist >= 50 )
{
imoney = iWaist * 80 + ( itrousers - iWaist )*45;
}
else
{
imoney = iWaist * 100 + ( itrousers - iWaist )*45;
}
}
printf("monye = %d\n", imoney);
return 0;
}

Ⅳ C語言。某服裝店賣套裝,若買的數量不少於50套,每套80;不足50套,每套90;單上衣60;單褲子45。求價錢

沒有啊,我按照你的代碼運行了,一下,輸入的都是60 ,最終結果為4800,60*80=4800。你想多了,或者手抖了。

Ⅵ C語言。某服裝店賣套裝,若買的數量不少於50套,每套80;不足50套,每套90;單上衣60;單褲子

程序沒有錯,你錯誤的原因我猜是逗號錯打成了中文的逗號(,)應該用英文的(,)
仔細看是有分別的 一個佔2位元組 一個佔1位元組
求採納。

熱點內容
安卓開發選哪個版本的SDK 發布:2025-07-02 22:19:07 瀏覽:485
未上傳圖片 發布:2025-07-02 22:14:01 瀏覽:598
安卓qq直播怎麼分享聲音 發布:2025-07-02 22:13:21 瀏覽:249
安卓系統怎麼刷機清除內存 發布:2025-07-02 22:08:19 瀏覽:696
安卓手機6位數密碼有多少組 發布:2025-07-02 21:50:31 瀏覽:797
存儲卡視頻多了 發布:2025-07-02 21:49:40 瀏覽:850
ajax無刷新上傳圖片 發布:2025-07-02 21:32:56 瀏覽:117
編譯器不認pow函數 發布:2025-07-02 21:27:04 瀏覽:339
w10隱藏文件夾 發布:2025-07-02 21:27:03 瀏覽:534
電腦d盤拒絕訪問 發布:2025-07-02 21:27:02 瀏覽:779