标签:== using 通过 tor cto iostream game 升级版 for
Input
一个正整数n,n<=100000
Output
Sample Input
8
Sample Output
1 #include<iostream> 2 using namespace std; 3 #include<cstring> 4 #include<cstdio> 5 #include<cmath> 6 #include<vector> 7 typedef long long ll; 8 void out(ll x,ll y,ll z,char c){ 9 printf("%I64d %c %I64d = %I64d\n",x,c,y,z); 10 } 11 int main(){ 12 ll n; 13 cin>>n; 14 if(n<4){ 15 printf("NO"); 16 return 0; 17 } 18 printf("YES\n"); 19 if(n==4){ 20 out(1,2,2,‘*‘); 21 out(2,3,6,‘*‘); 22 out(6,4,24,‘*‘); 23 } 24 else if((n&1)==0){ 25 out(1,2,2,‘*‘); 26 out(2,3,6,‘*‘); 27 out(6,4,24,‘*‘); 28 for(int i=n;i>4;i-=2){ 29 out(i,i-1,(long long)i-(i-1),‘-‘); 30 out(1,24,24,‘*‘); 31 } 32 } 33 else{ 34 out(3,4,12,‘*‘); 35 out(5,2,3,‘-‘); 36 out(3,1,2,‘-‘); 37 out(2,12,24,‘*‘); 38 if(n==5) 39 return 0; 40 for(int i=n;i>5;i-=2){ 41 out(i,i-1,(long long)i-(i-1),‘-‘); 42 out(1,24,24,‘*‘); 43 } 44 } 45 return 0; 46 }
标签:== using 通过 tor cto iostream game 升级版 for
原文地址:https://www.cnblogs.com/xfww/p/8810317.html