茵茵的第一课

xiaoxiao2021-02-28  88

茵茵的第一课

时间限制: 3000 ms  |  内存限制: 65535 KB 难度: 0 描述

茵茵今年已经六年级了,爸爸给她报了一个学习程序设计的班。

第一节课上,老师讲的就是如何输入一个数,再原样输出出来。

以现在的你看来,挺容易的是不? 那么,就请你也写出一个一样的程序吧

输入 第一行是一个整数N(N<10)表示测试数据的组数) 接下来的n行 每行只有一个数(可能是小数,也可能是整数) 这个数的位数(整数位数+小数位数)不超过19位 输出 原样输出每个数,每输出占一行 样例输入 23.55 样例输出 3.55 来源 2008年小学生程序设计友谊赛试题

上传者

代码:

#include <iostream> #include <stdio.h> #include <string.h> #include <math.h> #include <vector> #include <queue> #include <stack> #include <map> #include <string> #include <algorithm> using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) { int n; scanf("%d",&n); while(n--){ char input[20]; scanf("%s",input); printf("%s\n",&input); } return 0; }

转载请注明原文地址: https://www.6miu.com/read-72714.html

最新回复(0)