Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
76128 李雨昊 打印反直角三角形 C++ Compile Error 0 MS 0 KB 312 2024-06-01 17:06:57

Tests(0/0):


Code:

#include<stdio.h> #include<iostream> u sing namespace std; int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ for(int j=1;j<=n-i;j++){ cout<<" "; } for(int j=1;j<=i;j++){ cout<<"*"; } cout<<endl; } return 0; }


Run Info:

Main.cc:2:20: warning: extra tokens at end of #include directive
 #include u
                    ^
Main.cc:3:1: error: 'sing' does not name a type
 sing namespace std;
 ^
Main.cc: In function 'int main()':
Main.cc:6:5: error: 'cin' was not declared in this scope
     cin>>n;
     ^
Main.cc:6:5: note: suggested alternative:
In file included from Main.cc:2:0:
/usr/include/c++/5/iostream:60:18: note:   'std::cin'
   extern istream cin;  /// Linked to standard input
                  ^
Main.cc:9:13: error: 'cout' was not declared in this scope
             cout<<" ";
             ^
Main.cc:9:13: note: suggested alternative:
In file included from Main.cc:2:0:
/usr/include/c++/5/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^
Main.cc:12:13: error: 'cout' was not declared in this scope
             cout<<"*";
             ^
Main.cc:12:13: note: suggested alternative:
In file included from Main.cc:2:0:
/usr/include/c++/5/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^
Main.cc:14:9: error: 'cout' was not declared in this scope
         cout<& __os)
     ^