|
|
вернуться в форумTo admins: Go gets WA1, C++ gets AC My solutions in the two languages produce the same output on my tests. However, the Go version gets WA1. Please fix this. Re: To admins: Go gets WA1, C++ gets AC Послано Ярбек 26 окт 2017 09:09 #include<iostream> #include <stdio.h> #include <stdlib.h> #include <string> using namespace std; int main() { long l; string a,b; cin>>a; l=a.length(); if((l>=10)&&(l<=189)) { b=a.substr(l-2,2);
} else if((l>=190)&&(l<=2700)) b=a.substr(l-3,3); else if((l<=2701)&&(l<=36000)) b=a.substr(l-4,4); else b=a.substr(l-5,5); cout<<"//CPP"<<endl; cout<<"#include<iostream.h>"<<endl; cout<<"int main()"<<endl; int i = atoi(b.c_str()); cout<<"{for(int i=1;i<"<<i+1<<";i++)cout<<i;return 0;}"; return 0; } |
|
|