幫我找BUG 有功者賞看主公洗澡機會

2021-05-22 12:17:02 字數 2179 閱讀 3226

各位上仙,本人剛入門,寫了個c primer plus的課後程式設計練習,但總覺著**有點問題,請各位上仙幫瞧瞧。

#include

#include

#include

#include

int exec_class(int c_class,float c_money);

bool chenk_class(void);

float get_num(int num_s);

int main()while(chenk_class()==true);

return 0;

bool chenk_class()

char ch1;

ch1=getchar();

if(ch1=='y')else if(ch1=='n')else else if (num_s==2){

while((scanf("%f",&input_flo))!=1 || input_flo<0){

while (ch=getchar()!='/n')

printf("%c",ch);

printf(" 不是乙個合法的數字,請重新輸入.../nnotice:please intput a num like 10  25  74 ....(按0退出)/n ");

return input_flo;

int exec_class(int c_class,float money_total){

float money_end=0;

switch(c_class)

case 1:

if (money_total>17850){

money_end=17850*0.15+(money_total-17850)*0.28;

printf("您是單身,收入為%d",money_total);

printf("稅金為:%.2f/n",money_end);

if (money_total<=17850){

printf("您是單身,收入為%f",money_total);

money_end=money_total*0.15;

printf("稅金為:%.2f/n",money_end);

break;

case 2:

if (money_total>23900){

money_end=23900*0.15+(money_total-23900)*0.28;

printf("您是戶主,收入為%f",money_total);

printf("稅金為:%.2f/n",money_end);

if (money_total<=23900){

money_end=money_total*0.15;

printf("您是戶主,收入為%f",money_total);

printf("稅金為:%.2f/n",money_end);

break;

case 3:

if (money_total>29750){

money_end=29750*0.15+(money_total-29750)*0.28;

printf("您是已婚共有,收入為%f",money_total);

printf("稅金為:%.2f/n",money_end);

if (money_total<=29750){

money_end=money_total*0.15;

printf("您是已婚共有,收入為%f",money_total);

printf("稅金為:%.2f/n",money_end);

break;

case 4:

if (money_total>14875){

money_end=14875*0.15+(money_total-14875)*0.28;

printf("您是離異,收入為%f",money_total);

printf("稅金為:%.2f/n",money_end);

if (money_total<=14875){

money_end=money_total*0.15;

printf("您是離異,收入為%f",money_total);

printf("稅金為:%.2f/n",money_end);

break;

default:break;

return 0;

找Bug的歷程

一.碼畜 靠編譯器幫自己查語法錯誤 消滅筆誤 編寫適合程式設計師的鍵盤練習 if 常量 變數或表示式 使用goto接力超長的if,switch 連續的if還是if elseif 多個條件的組合 精心的排版 多重括號的匹配 條件編譯 各種const 不要糾結各種常量了,這個世界上唯一不變的就是變化。用...

《bug的獻詩》 獻給找bug的QA

bug的獻詩 獻給找bug的qa你誕生在開發指間 遮擋了產品的美 上線後短暫的狂喜 你從上帝的指尖暴露 你從 裡來,我到 裡去 你和我相愛相殺直到黎明 因為有你 所以給我安慰 上線之後短暫的狂喜 你逆襲成p0,榮登bug的聖殿 帶走了我一年的收成 留在原地的我,被埋的很深 佩刀閃閃發亮,一坨坨堆在前...

軟體測試是找BUG,不是找茬

做測試久了,經常會有一些感悟,最近在51上看到一貼,說出了我的心聲,把我一直想寫卻一直以時間為藉口為由拖著未寫的心聲寫出來,摘抄了部分過不,一起紀念測試的年代,測試的心聲。測試好象一直會被一些人誤解 測試就是找茬!經常被問到 你是做什麼的?回答 測試 時,別人馬上反問 你會不會編軟體呀?我說 不會,...