/ SeriousOJ /

Record Detail

Compile Error

foo.c:2:1: error: unknown type name 'using'
    2 | using namespace std;
      | ^~~~~
foo.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    2 | using namespace std;
      |                 ^~~
foo.c: In function 'main':
foo.c:7:9: error: 'cin' undeclared (first use in this function)
    7 |         cin>>n;
      |         ^~~
foo.c:7:9: note: each undeclared identifier is reported only once for each function it appears in
foo.c:14:9: error: 'cout' undeclared (first use in this function); did you mean 'count'?
   14 |         cout<<count<<endl;
      |         ^~~~
      |         count
foo.c:14:22: error: 'endl' undeclared (first use in this function)
   14 |         cout<<count<<endl;
      |                      ^~~~

Code

#include <stdio.h>
using namespace std;

int main()
{
    int n;
	cin>>n;
	int count=0;
	for(int i=1;i<n;i++)
	{
		if(i*i<=n) count++;
		if(i*(i+1)<=n) count++;
	}
	cout<<count<<endl;
	return 0;
}

Information

Submit By
Type
Submission
Problem
P1191 A. Balanced Product
Contest
Brain Booster #10
Language
C99 (GCC 13.2.0)
Submit At
2025-06-13 15:36:31
Judged At
2025-06-13 15:36:31
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes