#include <iostream> using namespace std; int main(){ int n; cin>>n; int x[n+5]; for(int i = 1;i<=n;i++){ cin>>x[i]; } for(int i = 1;i<=n;i++){ if(x[i]==1){ cout<<-1; }else if(x[i]==2){ cout<<1; }else if(x[i]==3){ cout<<7; }else if(x[i]==4){ cout<<4; }else if(x[i]==5){ cout<<2; }else if(x[i]==6){ cout<<6; }else if(x[i]==7){ cout<<8; }else if(x[i]==10){ cout<<22; }else{ int a = x[i]%7; switch(a){ case 0:{ for(int j = 1;j<=x[i]/7;j++){ cout<<8; } break; } case 1:{ cout<<10; for(int j = 1;j<=x[i]/7-1;j++){ cout<<8; } break; } case 2:{ cout<<18; for(int j = 1;j<=x[i]/7-1;j++){ cout<<8; } break; } case 3:{ cout<<200; for(int j = 1;j<=x[i]/7-2;j++){ cout<<8; } break; } case 4:{ cout<<20; for(int j = 1;j<=x[i]/7-1;j++){ cout<<8; } break; } case 5:{ cout<<28; for(int j = 1;j<=x[i]/7-1;j++){ cout<<8; } break; } case 6:{ cout<<68; for(int j = 1;j<=x[i]/7-1;j++){ cout<<8; } break; } } } cout<<endl; } return 0; }
标签:std,int,2024,木棍,main,csp From: https://www.cnblogs.com/wangyihang-xh/p/18606296