在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1 #include <stdio.h> 2 #include <stdlib.h> 3 4 struct student{ 5 int num; 6 char str[20]; 7 double dec; 8 }; 9 10 void scan(struct student *stu){ 11 // scanf("%d%s%lf", &stu->num, stu->str, &stu->dec); 12 scanf("%d%s%lf", &(*stu).num, (*stu).str, &(*stu).dec);//.运算符优先级大于* 13 } 14 15 void print(struct student stu){ 16 printf("%d %s %lf\n", stu.num, stu.str, stu.dec); 17 } 18 19 int main(){ 20 21 struct student stu; 22 23 scan(&stu); 24 print(stu); 25 26 return 0; 27 } 28 /* 29 20 字符串 20.02 30 */
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论