首页
博客使用须知
Search
1
沉金工艺介绍
103 阅读
2
板载天线介绍
87 阅读
3
Python-童叟皆懂,一文涵盖你想知道的经典
84 阅读
4
「题解」航电ACM2001-计算两点间的距离
67 阅读
5
单词记忆背诵辅助工具
60 阅读
HarmonyOS
HarmonyOS入门
原创
原创工具
python系列
pip类
知识整理Py
c++
知识整理C
随笔
网页
概览
假日限定
默认分类
proj
登录
Search
标签搜索
原创
c++
题解
pip
python
工作室原创
软件
杭电ACM
NOI
HarmonyOS
pygame
windows
html
网页设计
版权
结构体
调试
安装
后端
开发语言
虹棠包
累计撰写
25
篇文章
累计收到
5
条评论
首页
栏目
HarmonyOS
HarmonyOS入门
原创
原创工具
python系列
pip类
知识整理Py
c++
知识整理C
随笔
网页
概览
假日限定
默认分类
proj
页面
博客使用须知
搜索到
3
篇与
的结果
2023-12-12
「题解」航电ACM2001-计算两点间的距离
Creation:2023/12/10 17:00:27 Problem ID:2001Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem Description输入两点坐标(X1,Y1),(X2,Y2),计算并输出两点间的距离。Input输入数据有多组,每组占一行,由4个实数组成,分别表示x1,y1,x2,y2,数据之间用空格隔开。Output对于每组输入数据,输出一行,结果保留两位小数。Sample Input0 0 0 1 0 1 1 0Sample Output1.00 1.41AuthorlcySourceC语言程序设计练习(一)Solution用勾股定理然后计算输出即可#include<stdio.h> #include<math.h> int main() { double a,b,c,d; while(scanf("%lf%lf%lf%lf",&a,&b,&c,&d) != EOF) printf("%.2lf\n",sqrt((a-c)*(a-c)+(b-d)*(b-d))); return 0; }
2023年12月12日
67 阅读
0 评论
0 点赞
2023-12-12
「Solution」航电ACM2000-ASCII码排序
Creation:2023/12/10 16:09:49 Problem ID:2000Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem Description输入三个字符后,按各字符的ASCII码从小到大的顺序输出这三个字符。Input输入数据有多组,每组占一行,有三个字符组成,之间无空格。Output对于每组输入数据,输出一行,字符中间用一个空格分开。Sample Inputqwe asd zxcSample Outpute q w a d s c x zAuthorlcySourceC语言程序设计练习(一)Solution#include<stdio.h> int main() { char a[3],t;//用一维数组存储 while(scanf("%s",&a) != EOF)//以字符串的方式按行读入 { for(int i=0;i<=1;i++)//冒泡排序 for(int j=i+1;j<=2;j++) { if(a[i]>a[j]) { t = a[i];a[i] = a[j];a[j] = t; } } printf("%c %c %c\n",a[0],a[1],a[2]); } return 0; }
2023年12月12日
27 阅读
0 评论
0 点赞
2023-12-12
「Solution」A+B Problem N-VIII
Creation:2023/12/10 14:31:38 这章的题都挺简单,是对输入输出的练习,直接附答案了。但也欢迎大家评论区留言和讨论~A + B ProblemProblem ID:1000Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionCalculate A + B.InputEach line will contain two integers A and B. Process to end of file.OutputFor each case, output A + B in one line.Sample Input1 1Sample Output2AuthorHDOJSolution注意,这里题目要求是Process to end of file.,故要用EOF判断输入的结束。#include<stdio.h> int main() { int a,b; while(scanf("%d%d",&a,&b) != EOF) printf("%d\n",a+b); return 0; }A+B for Input-Output Practice (I)Problem ID:1089Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionYour task is to Calculate a + b.Too easy?! Of course! I specially designed the problem for acm beginners.You must have found that some problems have the same titles with this one, yes, all these problems were designed for the same aim.InputThe input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line.OutputFor each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input.Sample Input1 5 10 20Sample Output6 30AuthorlcySolution#include<stdio.h> int main() { int a,b; while(scanf("%d%d",&a,&b) != EOF) printf("%d\n",a+b); return 0; }A+B for Input-Output Practice (II)Problem ID:1090Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionYour task is to Calculate a + b.InputInput contains an integer N in the first line, and then N lines follow. Each line consists of a pair of integers a and b, separated by a space, one pair of integers per line.OutputFor each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input.Sample Input21 510 20Sample Output630AuthorlcySolution#include<stdio.h> int main() { int n,a,b; scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%d%d",&a,&b); printf("%d\n",a+b); } return 0; }A+B for Input-Output Practice (III)Problem ID:1091Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionYour task is to Calculate a + b.InputInput contains multiple test cases. Each test case contains a pair of integers a and b, one pair of integers per line. A test case containing 0 0 terminates the input and this test case is not to be processed.OutputFor each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input.Sample Input1 5 10 20 0 0Sample Output6 30AuthorlcySolution#include<stdio.h> int main() { int a,b,c; while(true) { scanf("%d%d",&a,&b); if(a ==0 && b==0) break; printf("%d\n",a+b); } return 0; }A+B for Input-Output Practice (IV)Problem ID:1092Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionYour task is to Calculate the sum of some integers.InputInput contains multiple test cases. Each test case contains a integer N, and then N integers follow in the same line. A test case starting with 0 terminates the input and this test case is not to be processed.OutputFor each group of input integers you should output their sum in one line, and with one line of output for each line in input.Sample Input4 1 2 3 4 5 1 2 3 4 5 0Sample Output10 15AuthorlcySolution#include<stdio.h> int main() { int n,a,sum=0; while(true) { scanf("%d",&n); if(n == 0) break; for(int i=1;i<=n;i++) { scanf("%d",&a); sum += a; } printf("%d\n",sum); sum = 0; } return 0; }A+B for Input-Output Practice (V)Problem ID:1093Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionYour task is to calculate the sum of some integers.InputInput contains an integer N in the first line, and then N lines follow. Each line starts with a integer M, and then M integers follow in the same line.OutputFor each group of input integers you should output their sum in one line, and with one line of output for each line in input.Sample Input2 4 1 2 3 4 5 1 2 3 4 5Sample Output10 15AuthorlcySolution#include<stdio.h> int main() { int n,m,a,sum=0; scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%d",&m); for(int j=1;j<=m;j++) { scanf("%d",&a); sum += a; } printf("%d\n",sum); sum = 0; } return 0; }A+B for Input-Output Practice (VI)Problem ID:1094Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionYour task is to calculate the sum of some integers.InputInput contains multiple test cases, and one case one line. Each case starts with an integer N, and then N integers follow in the same line.OutputFor each test case you should output the sum of N integers in one line, and with one line of output for each line in input.Sample Input4 1 2 3 4 5 1 2 3 4 5Sample Output10 15AuthorlcySolution#include<stdio.h> int main() { int n,a,sum=0; while(scanf("%d",&n) != EOF) { for(int i=1;i<=n;i++) { scanf("%d",&a); sum += a; } printf("%d\n",sum); sum = 0; } return 0; }A+B for Input-Output Practice (VII)Problem ID:1095Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionYour task is to Calculate a + b.InputThe input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line.OutputFor each pair of input integers a and b you should output the sum of a and b, and followed by a blank line.Sample Input1 5 10 20Sample Output630AuthorlcySolution#include<stdio.h> int main() { int a,b; while(scanf("%d%d",&a,&b) != EOF) printf("%d\n",a+b); return 0; }A+B for Input-Output Practice (VIII)Problem ID:1096Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionYour task is to calculate the sum of some integers.InputInput contains an integer N in the first line, and then N lines follow. Each line starts with a integer M, and then M integers follow in the same line.OutputFor each group of input integers you should output their sum in one line, and you must note that there is a blank line between outputs.Sample Input3 4 1 2 3 4 5 1 2 3 4 5 3 1 2 3Sample Output10 15 6AuthorlcySolution#include<stdio.h> int main() { int n,m,a,sum=0; scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%d",&m); for(int j=1;j<=m;j++) { scanf("%d",&a); sum += a; } printf("%d\n\n",sum); sum = 0; } return 0; }Sum ProblemProblem ID:1001Time Limit: 1000/500 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionHey, welcome to HDOJ(Hangzhou Dianzi University Online Judge).In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n.InputThe input will consist of a series of integers n, one integer per line.OutputFor each case, output SUM(n) in one line, followed by a blank line. You may assume the result will be in the range of 32-bit signed integer.Sample Input1 100Sample Output15050AuthorDOOM IIISolution#include<stdio.h> int main() { int n,sum=0; while(scanf("%d",&n) != EOF) { for(int i=1;i<=n;i++) sum+=i; printf("%d\n\n",sum); sum = 0; } return 0; }
2023年12月12日
29 阅读
0 评论
0 点赞