结构体 练习1
来源:互联网 发布:mac办公软件收费吗 编辑:程序博客网 时间:2024/06/03 09:25
1
#include "stdio.h"struct book{char title[50];char author[50];float value;}library;main(){ struct book library; printf("now erter the book title"); gets(library.title); printf("now erter the author"); gets(library.author); printf("now enter the value.\n"); scanf("%f",&library.value); printf("%s by %s : $%.2f\n",library.title,library.author,library.value); printf("%s by %s : $%.2f\n",library.author,library.title,library.value); printf("done.\n"); }
2
#include "stdio.h"#define len 20const char msgs[5][50]={/*也可为 *msgs[5](指针约等于数组 c 254页) 与msgs[5][50]相同 */"thank you for the wonderful evening,","you certainly prove that a ","is a special kind of guy, we must get togher","over a delicious "," and have a few laughs "};struct names{char first[len];char last[len];};struct guy{struct names handle;char favfood[len];char job[len];float income;};int main(void){struct guy fellow={{"ewen","villard"},"grilled salmon","personality coach",58112.00};printf("dear %s, \n\n",fellow.handle.first);printf("%s%s.\n",msgs[0],fellow.handle.first);printf("%s%s.\n",msgs[1],fellow.job);printf("%s\n",msgs[2]);printf("%s%s%s",msgs[3],fellow.favfood,msgs[4]);if(fellow.income>150000.0) puts("!!");else if(fellow.income>75000.0) puts("!");else puts(".");printf("\n%40s%s\n"," ","see you soon, "); printf("%40s%s\n,"," ","shalala");return 0;}
0 0
- 结构体 练习1
- 结构体练习
- 结构体练习
- 结构体练习-电子词典
- 结构体练习
- 结构体排序练习
- 结构体练习
- 循环结构练习1
- 结构体练习,学生成绩
- HPU2017-sort+结构体练习
- 【c基础练习】结构体
- C语言结构练习1
- 用指针指向结构体的练习
- Day8_c语言_结构体练习
- 结构体练习统计学生成绩
- 结构体数据的逆向练习
- [swift学习之四]结构体练习
- 第十六周练习--复数结构体
- <细节>C++函数形参表调用顺序
- VC中利用多线程技术实现线程之间的通信
- Scripts:查看耗用buffer cache最多的10个SQL的脚本hbuf10.sql
- LayoutInflater 全方位描述
- HDU1010第一道DFS
- 结构体 练习1
- 数据结构与算法分析10(排序-插入、冒泡、希尔、堆、归并)
- Holding Bin-Laden Captive!
- 关于对话框OnPaint 不调用基类CDialog::OnPaint方法CPU消耗很大达到70%以上问题
- week14闲来无事
- iOS开发准备篇-(3)Safari常用快捷键
- poj 3155 Hard Life(最大密度子图,01分数规划)
- Linux学习之CentOS(七)--CentOS下j2ee环境搭建
- Scripts:查询使用临时表空间最多的10个SQL htemp10.sql