Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
27605 唐心 比较三个数的大小 C++ Accepted 1 MS 732 KB 426 2022-06-07 11:15:54

Tests(1/1):


Code:

#include<iostream> #include<cstdio> #include<cstring> using namespace std; int main() { int *p1,*p2,*p3,*t = new int; int a,b,c; p1 = &a; p2 = &b; p3 = &c; cin>>a>>b>>c; if(*p1<*p2) { *t = *p1; *p1 = *p2; *p2 = *t; } if(*p1<*p3) { *t = *p1; *p1 = *p3; *p3 = *t; } if(*p2<*p3) { *t = *p2; *p2 = *p3; *p3 = *t; } cout<<*p1<<" "<<*p2<<" "<<*p3; return 0; }