C/C++ 结构体 数组 简单输入输出
2024-10-11 07:02:01
#include <stdio.h>
#include <stdlib.h> struct student{
int num;
char str[];
double dec;
}; int main(){ int n;
struct student stu[]; scanf("%d", &n);
for(int i = ; i < n; ++i){
scanf("%d%s%lf", &stu[i].num, stu[i].str, &stu[i].dec);
} printf("%d\n", n);
for(int i = ; i < n; ++i){
printf("%d %s %lf\n", stu[i].num, stu[i].str, stu[i].dec);
}
return ;
}
/*
3
20 字符串0 20.02
21 字符串1 21.12
22 字符串2 22.22
*/
最新文章
- jsp实验二
- Python 代码优化常见技巧
- Wix 安装部署教程(三)自定义安装界面和行为
- mongodb版本管理
- [LeetCode] Single Number III ( a New Questions Added today)
- struts2源代码学习之初始化(一)
- volatile之一--volatile不能保证原子性
- php抓取页面的几种方法详解
- Composer入门
- Maven之多模块打包成一个jar包及assembly
- Linux下crontab命令添加Kettle作业定时任务
- iOS APP上架被拒重新提交审核教程
- 语句、变量等js最基本知识
- 【Shell】单行注释和多行注释
- angular ng-repeat出来的数据 每条修改数据后返回给接口 如何取到每个对应修改的值
- HDU 1025(最长上升子序列)
- 【工具相关】Web--nodejs的安装
- 用pigz代替gzip -- 并行压缩软件
- js选择器 querySelector
- Codeforces 821C Okabe and Boxes(模拟)