Task: | Kolikot |
Sender: | N00B.exe |
Submission time: | 2018-10-07 15:00:37 +0300 |
Language: | C++ |
Status: | COMPILE ERROR |
Compiler report
input/code.cpp:1:1: error: stray '\377' in program ��/ / # i n c l u d e " s t d a f x . h " ^ input/code.cpp:1:2: error: stray '\376' in program ��/ / # i n c l u d e " s t d a f x . h " ^ input/code.cpp:1:4: warning: null character(s) ignored ��/ / # i n c l u d e " s t d a f x . h " ^ input/code.cpp:1:6: warning: null character(s) ignored ��/ / # i n c l u d e " s t d a f x . h " ^ input/code.cpp:1:7: error: stray '#' in program ��/ / # i n c l u d e " s t d a f x . h " ^ input/code.cpp:1:8: warning: null character(s) ignored ��/ / # i n c l u d e " s t d a f x . h " ^ input/code.cpp:1:10: warning: null character(s) ignored ��/ / # i n c l u d e " s t d a f x . h " ^ input/code.cpp:1:12: warning: null character(s) ignored ��/ / # i n c l u d e " s t d a f x . h " ^ input/code.cpp:1:14: warning: null character(s) ignored ��/ / # i n c l u d e " s t d a f x . h " ^ inp...
Code
��//#include "stdafx.h"#include <iostream>#include <math.h>using namespace std;int main(){//Init variables and get nint n, ans, omit, i;int test = 0;scanf("%i", &n);//Formula for the amount of stacks, derived from the properties of the sum 1+2+3+4...ans = (int)(sqrt(8*n + 1) / 2 - 0.5);printf("%i\n", ans);ans++;//Don't print this numberomit = ans*((ans+1.0)/2)-n;for(i = 1; i <= ans; i++){if(i == omit){ continue; }//Logic to have proper spacingif(n == 0){ printf(" "); }else{ n = 0; }printf("%i", i);test += i;}//And we are finishedprintf("\n");return 0;}