练习3-发工资

来源:互联网 发布:mac系统远程桌面工具 编辑:程序博客网 时间:2024/03/29 09:39

工资每小时20元,超出40h每h30元。输入时间输出工资;

source code:

#include <stdio.h>#include <stdlib.h>int main(){    int salary=0;    int hour;        printf("please input working hour\n");    scanf("%d",&hour);        if (hour>40) {        salary=(hour-40)*30;        hour=40;    }    salary+=hour*20;    printf("The salary is %d\n",salary);    return 0;}


0 0
原创粉丝点击