解题思路:
注意事项:
参考代码:
#include<stdio.h> #include<stdlib.h> struct book { char name[9]; float tw; int ks; struct book *next; }; typedef struct book like; int main() { int m,i=0; like *h,*t,*q,*p; h=q=NULL; h=(like*)malloc(sizeof(like)); q=h; scanf("%d",&m); for(int i=0;i<m;i++) { t=(like*)malloc(sizeof(like)); scanf("%s %f %d",t->name,&t->tw,&t->ks); q->next=t; q=t; q->next=NULL; } p=h->next; while(p) { if(p->tw>=37.5&&p->ks==1) { printf("%s\n",p->name); i++; } p=p->next; } printf("%d\n",i); return 0; }
0.0分
1 人评分
矩形面积交 (Java代码)浏览:1222 |
C语言训练-求1+2!+3!+...+N!的和 (C语言代码)浏览:542 |
求圆的面积 (C语言代码)浏览:1271 |
2003年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:605 |
WU-复数求和 (C++代码)浏览:2015 |
本人酷爱递归实现很多问题,这里也是浏览:557 |
WU-格式化数据输出 (C语言代码)浏览:1755 |
完数 (C语言代码)浏览:693 |
printf基础练习2 (C语言代码)浏览:618 |
1908题解浏览:640 |