Language: C++

#include<iostream>
#include <string>
#include<algorithm>
#include <set>
using namespace std::

int main(void){
	ios::sync_with_stdio(false);
	int N,i,j,k;
	cin >> N;
	int d[N];
	for (i = 0; i < N; i++) cin >> d[i] >> endl;
	sort(d, d + N, greater<int>());
	j = 0;
	k = 0;
	for (i = 0; i < N-1; i++) {
		if(d[i]!=d[i+1]) j++
	}

	cout << j <<endl
	return 0;
}


Compiler output:
a.cc:7:1: error: expected identifier before 'int'
    7 | int main(void){
      | ^~~
a.cc:5:22: error: expected ';' before 'int'
    5 | using namespace std::
      |                      ^
      |                      ;
    6 | 
    7 | int main(void){
      | ~~~                   
a.cc: In function 'int main()':
a.cc:8:9: error: 'ios' has not been declared
    8 |         ios::sync_with_stdio(false);
      |         ^~~
a.cc:10:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |         cin >> N;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:12:48: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |         for (i = 0; i < N; i++) cin >> d[i] >> endl;
      |                                                ^~~~
      |                                                std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:13:24: error: 'greater' was not declared in this scope; did you mean 'std::greater'?
   13 |         sort(d, d + N, greater<int>());
      |                        ^~~~~~~
      |                        std::greater
In file included from /usr/include/c++/14/string:49,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40:
/usr/include/c++/14/bits/stl_function.h:353:12: note: 'std::greater' declared here
  353 |     struct greater;
      |            ^~~~~~~
a.cc:13:32: error: expected primary-expression before 'int'
   13 |         sort(d, d + N, greater<int>());
      |                                ^~~
a.cc:13:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   13 |         sort(d, d + N, greater<int>());
      |         ^~~~
      |         std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:3:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:17:37: error: expected ';' before '}' token
   17 |                 if(d[i]!=d[i+1]) j++
      |                                     ^
      |                                     ;
   18 |         }
      |         ~                            
a.cc:20:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |         cout << j <<endl
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:20:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   20 |         cout << j <<endl
      |                     ^~~~
      |                     std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~