Submission #1861884
Source Code Expand
#include <iostream> using namesspace std; int main(){ int n,x,s=0; cin >>n; cin >>x; while(x!=0){ s+=x; if( x>n-x) { int a=x; x=t-x; t=a; } else { x=t-x; } cout <<s; } }
Submission Info
Submission Time | |
---|---|
Task | B - Mysterious Light |
User | Genius28 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 228 Byte |
Status | CE |
Compile Error
./Main.cpp:2:7: error: expected nested-name-specifier before ‘namesspace’ using namesspace std; ^ ./Main.cpp: In function ‘int main()’: ./Main.cpp:5:2: error: ‘cin’ was not declared in this scope cin >>n; ^ ./Main.cpp:5:2: note: suggested alternative: In file included from ./Main.cpp:1:0: /usr/include/c++/5/iostream:60:18: note: ‘std::cin’ extern istream cin; /// Linked to standard input ^ ./Main.cpp:13:6: error: ‘t’ was not declared in this scope x=t-x; ^ ./Main.cpp:18:6: error: ‘t’ was not declared in this scope x=t-x; ^ ./Main.cpp:20:3: error: ‘cout’ was not declared in this scope cout <<s; ^ ./Main.cpp:20:3: note: suggested alternative: In file included from ./Main.cpp:1:0: /usr/include/c++/5/iostream:61:18: note: ‘std::cout’ extern ostream cout; /// Linked to standard output ^