C语言大师帮帮忙

C语言大师帮帮忙,第1张

#include "stdio.h"

struct A{

double x

char sn[5],gr[3],tm[11],dt[10],it[15]

double sal,bon

char name[11],lev

}

void bubsort(struct A *p,int n){

int i,j

struct A t

for(i=0i<ni++)

for(j=0j<n-1j++)

if(p[j].x<p[j+1].x)

t=p[j],p[j]=p[j+1],p[j+1]=t

}

void outinfo(struct A *p,int n){

int i

printf("庆帆\t成绩\t编号\t性别携唯\t时间\t\t部辩差培门\t物品\t工资\t奖金\t姓名\t等级\n")

printf("       ======================================================================================\n")

for(i=0i<ni++)

printf("\t%.2f\t%s\t%s\t%s\t%s\t%s\t%.2f\t%.2f\t%s\t%c\n",p[i].x,p[i].sn,\

p[i].gr,p[i].tm,p[i].dt,p[i].it,p[i].sal,p[i].bon,p[i].name,p[i].lev)

}

int main(int argc,char *argv[]){

struct A x[3]={{63.5,"1001","男","2018-9-1","通信","网线",5200.00,1000.00,"张三",'C'},

{97.5,"1002","男","2018-8-29","雷达","示波器",5500.00,2000.00,"李四",'A'},

{55.6,"1003","女","2018-8-31","网络","电脑",5100.00,0.00,"王五",'D'}}

bubsort(x,3)

outinfo(x,3)

return 0

}

运行样例:

#include<stdio.h>

int main()

{

int v

scanf("%d",&v)

if(v>60)

printf("Speed: %d - Speeding\搜首n"手扰,v)

else

printf("Speed: %d - OK\毕漏旦n",v)

return 0

}


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12562067.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-26
下一篇 2023-05-26

发表评论

登录后才能评论

评论列表(0条)

保存