小型公司工資管理系統(tǒng)
工資的計(jì)算方法:
A 經(jīng)理:固定月薪為8000;
B 技術(shù)員:工作時(shí)間*小時(shí)工資(100元每小時(shí));
C 銷售員:銷售額*4%提成;
D 銷售經(jīng)理:底薪(5000)+所轄部門銷售額總額*0.5%;
溫度華氏轉(zhuǎn)變攝氏
#include <stdio.h>
#include <stdlib.h>
enum x {A,B,C,D,E}
int main(void)
{
int a=73,b=85,c=66
{
if (a>=90)
printf("a=A等級(jí)!!\n")
else if (a>=80)
printf("73分=B等級(jí)!!\n")
else if (a>=70)
printf("73分=C等級(jí)!!\n")
else if (a>=60)
printf("73分=D等級(jí)!!\n")
else if (a<60)
printf("73分=E等級(jí)!!\n")
}
{
if (b>=90)
printf("b=A等級(jí)!!\n")
else if (b>=80)
printf("85分=B等級(jí)!!\n")
else if (b>=70)
printf("85分=C等級(jí)!!\n")
else if (b>=60)
printf("85分=D等級(jí)!!\n")
else if (b<60)
printf("85分=E等級(jí)!!\n")
}
{
if (c>=90)
printf("c=A等級(jí)!!\n")
else if (c>=80)
printf("66分=B等級(jí)!!\n")
else if (c>=70)
printf("66分=C等級(jí)!!\n")
else if (c>=60)
printf("66分=D等級(jí)!!\n")
else if (c<60)
printf("66分=E等級(jí)!!\n")
}
system("pause")
return 0
}
溫度華氏轉(zhuǎn)變攝氏
#include <stdio.h>
#include <stdlib.h>
enum x {A,B,C,D,E}
int main(void)
{
int a=73,b=85,c=66
{
if (a>=90)
printf("a=A等級(jí)!!\n")
else if (a>=80)
printf("73分=B等級(jí)!!\n")
else if (a>=70)
printf("73分=C等級(jí)!!\n")
else if (a>=60)
printf("73分=D等級(jí)!!\n")
else if (a<60)
printf("73分=E等級(jí)!!\n")
}
{
if (b>=90)
printf("b=A等級(jí)!!\n")
else if (b>=80)
printf("85分=B等級(jí)!!\n")
else if (b>=70)
printf("85分=C等級(jí)!!\n")
else if (b>=60)
printf("85分=D等級(jí)!!\n")
else if (b<60)
printf("85分=E等級(jí)!!\n")
}
{
if (c>=90)
printf("c=A等級(jí)!!\n")
else if (c>=80)
printf("66分=B等級(jí)!!\n")
else if (c>=70)
printf("66分=C等級(jí)!!\n")
else if (c>=60)
printf("66分=D等級(jí)!!\n")
else if (c<60)
printf("66分=E等級(jí)!!\n")
}
system("pause")
return 0
}
Problem B:Longest Ordered Subsequence
A numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subsequence of the given numeric sequence (a1, a2, ..., aN) be any sequence (ai1, ai2, ..., aiK), where 1 <= i1 < i2 < ... < iK <= N. For example, sequence (1, 7, 3, 5, 9, 4, 8) has ordered subsequences, e. g., (1, 7), (3, 4, 8) and many others. All longest ordered subsequences are of length 4, e. g., (1, 3, 5, 8).