六道题okokok

//根据折扣discount,计算并输出应收金额income,找零change. 
//price商品单价,pay收款金额,total商品总价,discount得到折扣,income应收金额,change找零,count购买数量 
#include <stdio.h>
int main(){
	float price,pay,total,discount,income,change;
	int count; 
	printf("请输入商品单价,购买数量,收款金额\n");
	scanf("%f%d%f",&price,&count,&pay);
	total=price*count;
	if(total<1000){
		discount=0; 
	}else if(total<3000){
		discount=0.05;
	}else if(total<6000){
		discount=0.1;
	}else if(total<8000){
		discount=0.15;
	}else{
		discount=0.2;
	}
	income=total*(1-discount);
	change=pay-income;
	printf("应收金额%f,找零%f",income,change); 
}
#include <stdio.h>
int main(){
	int s;
	scanf("%d",&s);
	if(s<=100&&s>=0){
		if(s>=90){
			printf("优"); 
		}else if(s>=80){
			printf("良");
		}else if(s>=70){
			printf("中");
		}else if(s>=60){
			printf("及格");
		}else{
			printf("不及格");
		}
	}else{
		printf("输入不合格"); 
	}
}
#include <stdio.h>
int main(){
	int i,j;
	for(i=1;i<=9;i++){
		for(j=1;j<=i;j++){
			printf("%d*%d=%d ",i,j,i*j);
		}
		printf("\n");
	}
}
#include <stdio.h>
int main(){
	int a,b,c,min;
	scanf("%d%d%d",&a,&b,&c);
	if(a>b){
		min=a;
		a=b;
		b=min;
	}
	if(a>c){
		min=a;
		a=c;
		c=min;
	}
	if(b>c){
		min=b;
		b=c;
		c=min;
	}
	printf("从小到大为%d%d%d",a,b,c);
}  
#include <stdio.h>
int main(){
	int i,j,k;
	for(i=1;i<=9;i++){
		for(j=0;j<=9;j++){
			for(k=0;k<=9;k++){
				if(i*i*i+j*j*j+k*k*k==i*100+j*10+k*1){
					printf("%d\t",i*100+j*10+k*1);
				}
			}
		}
	}
} 
#include <stdio.h>
int main()
{
	int year;
	scanf("%d",&year);
	if(year%4==0||year%100!=0&&year%400==0){
		printf("the year is leapyyear") ;
	} else{
		printf("the year is not leaoyear");
	}
}

#include <stdio.h>
int main()
{
	int year;
	scanf("%d",&year);
	if(year%4==0||year%100!=0&&year%400==0){
		printf("the year is leapyyear") ;
	} else{
		printf("the year is not leaoyear");
	}
}

//根据折扣discount,计算并输出应收金额income,找零change. 
//price商品单价,pay收款金额,total商品总价,discount得到折扣,income应收金额,change找零,count购买数量 
#include <stdio.h>
int main(){
	float price,pay,total,discount,income,change;
	int count; 
	printf("请输入商品单价,购买数量,收款金额\n");
	scanf("%f%d%f",&price,&count,&pay);
	total=price*count;
	if(total<1000){
		discount=0; 
	}else if(total<3000){
		discount=0.05;
	}else if(total<6000){
		discount=0.1;
	}else if(total<8000){
		discount=0.15;
	}else{
		discount=0.2;
	}
	income=total*(1-discount);
	change=pay-income;
	printf("应收金额%f,找零%f",income,change); 
}

#include <stdio.h>
int main(){
	int s;
	scanf("%d",&s);
	if(s<=100&&s>=0){
		if(s>=90){
			printf("优"); 
		}else if(s>=80){
			printf("良");
		}else if(s>=70){
			printf("中");
		}else if(s>=60){
			printf("及格");
		}else{
			printf("不及格");
		}
	}else{
		printf("输入不合格"); 
	}
}

#include <stdio.h>
int main(){
	int i,j;
	for(i=1;i<=9;i++){
		for(j=1;j<=i;j++){
			printf("%d*%d=%d ",i,j,i*j);
		}
		printf("\n");
	}
}

#include <stdio.h>
int main(){
	int a,b,c,min;
	scanf("%d%d%d",&a,&b,&c);
	if(a>b){
		min=a;
		a=b;
		b=min;
	}
	if(a>c){
		min=a;
		a=c;
		c=min;
	}
	if(b>c){
		min=b;
		b=c;
		c=min;
	}
	printf("从小到大为%d%d%d",a,b,c);
} 

 

#include <stdio.h>
int main(){
	int i,j,k;
	for(i=1;i<=9;i++){
		for(j=0;j<=9;j++){
			for(k=0;k<=9;k++){
				if(i*i*i+j*j*j+k*k*k==i*100+j*10+k*1){
					printf("%d\t",i*100+j*10+k*1);
				}
			}
		}
	}
} 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值