<swustoj>?id=77 计算员工周工资

链接http://acm.swust.edu.cn/problem/77/

#include <stdio.h>
int main()
{
    double hour,money_hour,money;
    scanf("%lf %lf",&hour,&money_hour);
    if(hour<=0||hour>=168)
    {
        printf("input is wrong!\n");
    }
    else
    {
        if(hour<40)
        {
            money=hour*money_hour;
        }
        else
        {
            if(hour<=60)
            {
                money=40*money_hour+(hour-40)*1.5*money_hour;
            }
            else
            {
                money=40*money_hour+20*1.5*money_hour+(hour-60)*3*money_hour;
            }
        }
        printf("%g\n",money);
    }
    return 0;
}
时间: 2024-10-19 09:21:30

<swustoj>?id=77 计算员工周工资的相关文章

&lt;swustoj&gt;?id=78 计算生日是星期几

链接http://acm.swust.edu.cn/problem/0078/ #include <stdio.h> bool LeapYear(int year) { return((year%400==0)||(year%100!=0&&year%4==0)); } int main() { int i; int year,month,day; int sum; int monthday[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}

&lt;swustoj&gt;?id=80 计算n!

链接http://acm.swust.edu.cn/problem/0080/ #include <stdio.h>//递归 int factorial(int n) { if(n==1) { return 1; } else { return n*factorial(n-1); } } int main() { int n; while(~scanf("%d",&n)) { if(n<0||n>12) { printf("shuruwuxia

&lt;swustoj&gt;?id=203 Jack&#39;s problem

链接http://acm.swust.edu.cn/problem/203/ #include <stdio.h> int main() { double x1,x2,x3,y1,y2,y3; double s; while(~scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3)) { s=(x1*y2+x2*y3+x3*y1-x1*y3-x2*y1-x3*y2)*1

C 计算员工工资

#include <stdio.h> int main(int argc, char **argv) { //定义四个变量 g每小时固定的工资 40 固定工作时间 pay工资 hours员工的实际工作时间 const double g=9; const int s=40; double pay=0.0; int hours; // 输入员工的实际工作时间 printf("请输入员工 工作时间."); scanf("%d",&hours); pri

根据生日计算员工年龄

实现效果: 关键知识:(注意:引用 using Microsoft.VisualBasic;) DateAndTime类的DateDiff静态方法获取日期时间的间隔数: DateDiff(DateInterval Internal,DateTime Date1,DateTime date2,FirstDayOfWeek DayOfWeek,FirstWeekOfYear WeekOfYear); 实现代码: private void button1_Click(object sender, Ev

&lt;swustoj&gt;?id=1157 n个数的最小公倍数

链接http://acm.swust.edu.cn/problem/1157/ #include<stdio.h> int main() { int n,a[12],i,j; while(~scanf("%d",&n)) { for(i=0;i<n;i++) { scanf("%d",&a[i]); } for(i=a[0];;i++) { for(j=0;j<n;j++) { if(i%a[j]==0) { continue

&lt;swustoj&gt;?id=1158 比成绩

链接http://acm.swust.edu.cn/problem/1158/ #include <stdio.h> int main() { int n; int grade,averagegrade_1,sumgrade_1,averagegrade_2,sumgrade_2,count_1,count_2; int classnum; while(scanf("%d",&n)!=EOF) { count_1=count_2=0; sumgrade_1=sumg

&lt;swustoj&gt;?id=563 String

链接http://acm.swust.edu.cn/problem/563/ #include <stdio.h> #include <string.h> int main() { char str[105]; while(scanf("%s",str)!=EOF) { int leng = strlen(str),i; for(i = 0 ; i< leng ; i ++) { if(str[i]>='a'&&str[i]<=

&lt;swustoj&gt;?id=489 平方和与立方和

链接http://acm.swust.edu.cn/problem/489/ #include <stdio.h> int main() { int m,n; int temp,i,j; int sum_1,sum_2; int a[100005]; while(scanf("%d%d",&m,&n)!=EOF) { if(m>n) { temp=m; m=n; n=temp; } for(i=m;i<=n;i++) { a[i]=i; } su