//根据折扣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);
}
}
}
}
}