HDU 2000

来源:互联网 发布:c语言ascii码转换字符 编辑:程序博客网 时间:2024/04/27 23:09

特别特别水题 纯属通过水题找自信 仅供娱乐  另外 附上 C++ 中point的使用方法 Mark 一下


New~ 本学期最后一次入选"ACM校队"的机会——12月份月赛(赶快报名吧~)

ASCII码排序

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 74985    Accepted Submission(s): 30770


Problem Description
输入三个字符后,按各字符的ASCII码从小到大的顺序输出这三个字符。
 

Input
输入数据有多组,每组占一行,有三个字符组成,之间无空格。
 

Output
对于每组输入数据,输出一行,字符中间用一个空格分开。
 

Sample Input
qweasdzxc
 

Sample Output
e q wa d sc x z
 

#include <cmath>#include <cstdio>int main(void){    double x[2], y[2];    while (scanf("%lf%lf%lf%lf", x, y, x+1, y+1) != EOF)        printf("%.2f\n", sqrt((x[1]-x[0])*(x[1]-x[0]) + (y[1]-y[0])*(y[1]-y[0])));    return 0;}

下面是Point 的使用 需要在 定义一个Point 结构体 然后 没什么了

#include<iostream>#include<cstdio>using namespace std;typedef struct Point{    double  x;    double  y;}Point;void PrintPoint(Point p){    printf("%.4f ",p.x);    printf("%.4f", p.y);}int main(){    Point pt;    pt.x = 3.1415;    pt.y = 1.4725;    PrintPoint(pt);    return 0;}


原创粉丝点击