criyle/codenet-compile-errors huggingface dataset:
Language: C

#include <bits/stdc++.h>
using namespace std;

int main(void){
    string s;
    int k;
    cin >> k >> s;
    string  a[k];
    if (s.size()<=k){
        cout << s << endl;
    }else{
        for (int i = 0; i < k; i++){
            a[i] = s[i];
        }
        //a[k+1] = "...";
        for (int i = 0; i < k; i++) cout << a[i];
        cout << "...";        
   }
    cout << endl;

}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int K;
  string S;
  cin >> K >> S;
  if(K >= S.size())
    cout << S << endl;
  else{
    for(int i = 0; i < K; i++)
      cout << S.at(i);
    cout << ... << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: expected ';' before '<<' token
   12 |     cout << ... << endl;
      |         ^~~
      |         ;
Language: C++

#include <string>

using namespace std;

int main ()
{
  string S;
  int K;
  cin>>K;
  cin>>S;
  int M=S.size();
  if(M<=K)
  {
    cout<<S<<endl;
  }
  else
  {
    for(int n=0;n<K;n++)
    {
      cout<<S[n];
    }
    cout<<"…"<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope
    9 |   cin>>K;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <string>
  +++ |+#include <iostream>
    2 | 
a.cc:14:5: error: 'cout' was not declared in this scope
   14 |     cout<<S<<endl;
      |     ^~~~
a.cc:14:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:14: error: 'endl' was not declared in this scope
   14 |     cout<<S<<endl;
      |              ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <string>
  +++ |+#include <ostream>
    2 | 
a.cc:20:7: error: 'cout' was not declared in this scope
   20 |       cout<<S[n];
      |       ^~~~
a.cc:20:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:22:5: error: 'cout' was not declared in this scope
   22 |     cout<<"…"<<endl;
      |     ^~~~
a.cc:22:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:22:16: error: 'endl' was not declared in this scope
   22 |     cout<<"…"<<endl;
      |                ^~~~
a.cc:22:16: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C

#include<stdio.h>
#include<string.h>
int main(void){
  	char s[100];
  char i[100];
  	int a;
  int k;
  int b = 0;
  scanf("%d\n",&k);
  scanf("%s",s);
  a = strlen(s);
  if(k >= a){
    	printf("%s",s);
  }else{
		while(s[b] != NULL){
          b++;
          	printf("%c",s[b-k-1]);
        }
  }
  return 0;
}
    return 

Compiler output:
main.c: In function 'main':
main.c:15:28: warning: comparison between pointer and integer
   15 |                 while(s[b] != NULL){
      |                            ^~
main.c: At top level:
main.c:22:5: error: expected identifier or '(' before 'return'
   22 |     return
      |     ^~~~~~
Language: C

#include <stdio.h>
#include <string.h>

int main (void) {
    int K;
    char S[100];

    scanf ("%d%s", &K, S);

    if (K < strlen(S)) {
        for (int i = 0; i < K; i++) {
            printf("%c", S[i])
        }
        printf("...\n");
    } else {
        printf("%s\n", S);
    }

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:31: error: expected ';' before '}' token
   12 |             printf("%c", S[i])
      |                               ^
      |                               ;
   13 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int K;
  string S;
  cin >> K >> S;
  if(K >= S.size())
    cout << K << endl;
  else{
    for(int i = 0; i < K; i++)
      cout << K.at(i);
    cout << ... << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: request for member 'at' in 'K', which is of non-class type 'int'
   11 |       cout << K.at(i);
      |                 ^~
a.cc:12:9: error: expected ';' before '<<' token
   12 |     cout << ... << endl;
      |         ^~~
      |         ;
Language: C

#include<bits/stdc++.h>
using namespace std;
int main()
{
string text,str;
int k,a;

  cin >> k >> text;
  
  a=text.size();
  
  if(a<=k)
  {
  cout << text << endl;
  }
  
  else
  {str=text.substr(0,k);
  cout << str+"..." << endl;
  }
  
return 0;
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;

class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int k = sc.nextInt();
    int count = s.length();
    String add = "...";
    if(count > 100 || k > 100){
      System.out.println(error);
    }
    
    
    if(count =< k){
      System.out.println(s);
    }else if(count > k){
      String result = s + add;
      System.out.println(result);
    }
  }
}

Compiler output:
Main.java:15: error: > or ',' expected
    if(count =< k){
                 ^
1 error
Language: Java

import java.util.*;
public class Main
{
  public static void main(String args[])
  {
    Scanner sc=new Scanner(System.in);
    int K=sc.nextInt();
    String S=sc.nextLine();
    if(S.length<=K)
    {
      System.out.println("S");
    }
    else
    {
      String str=S.substring(K);
      str.append("...");
      System.out.println("str");
    }
  }
}


Compiler output:
Main.java:9: error: cannot find symbol
    if(S.length<=K)
        ^
  symbol:   variable length
  location: variable S of type String
Main.java:16: error: cannot find symbol
      str.append("...");
         ^
  symbol:   method append(String)
  location: variable str of type String
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int K;
  string S;
  cin >> K >> S;
  if(K >= S.size())
    cout << K << endl;
  else{
    for(int i = 0; i < K; i++_)
      cout << K.at(i);
    cout << ... << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:30: error: expected ')' before '_'
   10 |     for(int i = 0; i < K; i++_)
      |        ~                     ^
      |                              )
a.cc:10:30: error: '_' was not declared in this scope
a.cc:12:9: error: expected ';' before '<<' token
   12 |     cout << ... << endl;
      |         ^~~
      |         ;
Language: C++

#include <string>

using namespace std;

int main ()
{
  string S;
  int K;
  cin>>K;
  cout<<endl;
  cin>>S;
  int M=S.size();
  if(M<K)
  {
    cout<<S<<endl;
  }
  else
  {
    for(int n=0;n<K;n++)
    {
      cout<<S[n];
    }
    cout<<"…"<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope
    9 |   cin>>K;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <string>
  +++ |+#include <iostream>
    2 | 
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout<<endl;
      |   ^~~~
a.cc:10:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:9: error: 'endl' was not declared in this scope
   10 |   cout<<endl;
      |         ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <string>
  +++ |+#include <ostream>
    2 |
Language: Java

import java.util.*;
public class Main
{
  public static void main(String args[])
  {
    Scanner sc=new Scanner(System.in);
    int K=sc.nextInt();
    String S=sc.nextLine();
    if(S.length<=K)
    {
      System.out.println("S");
    }
    else
    {
      String str=S.substring(K));
      str.append("...");
      System.out.println("str");
    }
  }
}


Compiler output:
Main.java:15: error: ';' expected
      String str=S.substring(K));
                               ^
1 error
Language: C

#include<stdio.h>
#include<string.h>

int main(){
    int k;
	char ch[100];
	int i;
	
	scanf("%d",&k);
	scanf("%s",ch);

	int n = strlen(ch);

	if(n<= k){
	printf("%s",ch);
}
    else {
		for(i=0;i<=k-1;i++){
			printf("%c",ch[i]);
		}
      	    printf("...");
	}


Compiler output:
main.c: In function 'main':
main.c:22:9: error: expected declaration or statement at end of input
   22 |         }
      |         ^
Language: C++

using namespace std;

int main(){
  int a;
  char b[200]={0};
  int i;

  cin >> a >> b;
  for(i=0;i<a;i++){
    if(b[i]!=0) cout << b[i];
    else break;  
  }
  if(b[i+1]!=0) cout << "...";
  
}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> a >> b;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:10:17: error: 'cout' was not declared in this scope
   10 |     if(b[i]!=0) cout << b[i];
      |                 ^~~~
a.cc:10:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:17: error: 'cout' was not declared in this scope
   13 |   if(b[i+1]!=0) cout << "...";
      |                 ^~~~
a.cc:13:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int K;
  string S;
  cin>>K>>S;
  
  if(S.size()<=K)
    cout<< S << endl;
  
  else{
    for(i=0;i<K;i++){
      cout << S.at(i) <<endl;
    }
    cout<<"..."<<endl;
  }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'i' was not declared in this scope
   13 |     for(i=0;i<K;i++){
      |         ^
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main(){
  string S;
  int k = 0;
  
  cin >> k;
  cin >> S;

  for(int i = 0; i < k; i++)
    cout <<s[i];
  
  if(S.size() <= k) cout << endl;
  else cout << "..." << endl;
 
  return 0; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: 's' was not declared in this scope
   13 |     cout <<s[i];
      |            ^
Language: C++

#include <iostream>
#include <bitset>
#include <vector>
#include <stdio.h>
using namespace std;

int main(){
    char ch[100];
    //char ch_cp[100];
    int K;
    cin>>K;
    cin>>ch;
    int n=strlen(ch);
    //cout<<n<<endl;
    if(n<=K){
        cout<<ch<<endl;
    }else{
        for(int i=0;i!=K;++i){
            printf("%c",ch[i]);
        }
        cout<<"."<<"."<<"."<<endl;
    }
   
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: 'strlen' was not declared in this scope
   13 |     int n=strlen(ch);
      |           ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <vector>
  +++ |+#include <cstring>
    4 | #include <stdio.h>
Language: C++

#include "bits/stdc++.h"

using namespace std;

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int k, i;
  cin >> k;
  string s;
  cin >> s;
  int l = s.length()-1;  //cout << l << endl;
  if (k => l )
    cout << s << endl;
  else if (k < l)
    {
      for (i=0; i<k; i++)
          cout << s[i];
      cout << "..." << endl;
    }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: expected primary-expression before '>' token
   14 |   if (k => l )
      |          ^
Language: C

#include <stdio.h>
#include <string.h>

int main (void) {
    int K;
    char S[100] = 0, str[100] = 0;

    scanf ("%d%s", &K, S);

    if (K < strlen(S)) {
        strncpy (str, S, K);
        printf("%s...\n", str);
    } else {
        printf("%s\n", S);
    }

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:19: error: invalid initializer
    6 |     char S[100] = 0, str[100] = 0;
      |                   ^
main.c:6:33: error: invalid initializer
    6 |     char S[100] = 0, str[100] = 0;
      |                                 ^
Language: C

#include <stdio.h>
int main()
{
  int i,k;
  int s[101];
  

  scanf("%d",&k);
  scanf("%s"s);

for(i=0; s[i]!='\0'; ++i);{
    if(i < k+1)
    printf("%s",s);
    else{
    s[k] == '…';
    printf("%s",s);
  }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:13: error: expected ')' before 's'
    9 |   scanf("%s"s);
      |        ~    ^
      |             )
main.c:15:13: warning: multi-character character constant [-Wmultichar]
   15 |     s[k] == '…';
      |             ^~~
Language: C++

#include <iostream>
using namespace std;
int main() {
int n,i;cin>>n;
  string str;cin>>str;
  int x=str.length();  
  if(n>=x)
    cout<<str;
  else{
  for( i=o;i<n-1;i++)
    cout<<s[i];
    for(i=n;i<x;i++)
      cout<<".";
  }
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'o' was not declared in this scope
   10 |   for( i=o;i<n-1;i++)
      |          ^
a.cc:11:11: error: 's' was not declared in this scope
   11 |     cout<<s[i];
      |           ^
Language: Java

class Sol{
	public static void  main(String ... args){
      Scanner sc = new Scanner(System.in);
      int k = sc.nextInt();
      int s = sc.nextLine();
      if(s.length() <= k)
        System.out.print(s);
      else
        System.out.print(s.substring(0, k) + "...");

    }
}

Compiler output:
Main.java:3: error: cannot find symbol
      Scanner sc = new Scanner(System.in);
      ^
  symbol:   class Scanner
  location: class Sol
Main.java:3: error: cannot find symbol
      Scanner sc = new Scanner(System.in);
                       ^
  symbol:   class Scanner
  location: class Sol
Main.java:6: error: int cannot be dereferenced
      if(s.length() <= k)
          ^
Main.java:9: error: int cannot be dereferenced
        System.out.print(s.substring(0, k) + "...");
                          ^
4 errors
Language: C++

//modle
#include <bits/stdc++.h>
using namespace std;

int main()
{
	//freopen("modle.in","r",stdin);
	//freopen("modle.out","r",stdout);
	string s,k;
	cin>>s>>k;
	if(s==k)
		cout<<s;
	else if(s>=k)
		char s;
		char k;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:22: error: conflicting declaration 'char k'
   15 |                 char k;
      |                      ^
a.cc:9:18: note: previous declaration as 'std::string k'
    9 |         string s,k;
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int k;
  cin >> k;

  string s;
  cin >> s;

  if (s.size() <= k) {
    cout << s << endl;
  }
  else {
    cout << s.erase(k)  << "..." << endl;
  }
}




Compiler output:
a.cc:15:22: error: stray '\16' in program
   15 |     cout << s.erase(k<U+000E>)  << "..." << endl;
      |                      ^~~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main
{
int a;
string b; 
cin >> a ; 
cin >> b ; 
if(a==b.size()){
cout << b ;}
else
{
  
for(int i=0; i<a; i++)
  {cout << b[i];} 
  cout << "..." ;
}

}


Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main
      |     ^~~~
a.cc:5:1: error: expected primary-expression before 'int'
    5 | int a;
      | ^~~
a.cc:5:1: error: expected '}' before 'int'
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
a.cc:7:1: error: 'cin' does not name a type
    7 | cin >> a ;
      | ^~~
a.cc:8:1: error: 'cin' does not name a type
    8 | cin >> b ;
      | ^~~
a.cc:9:1: error: expected unqualified-id before 'if'
    9 | if(a==b.size()){
      | ^~
a.cc:11:1: error: expected unqualified-id before 'else'
   11 | else
      | ^~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int K;cin >> K;
  string str;cin >> str;
  if (str.size()<=K){
    cout << str << endl;
  }
  else {
    for (int i=0;i<K;i++){
      cout << str.at(i);
    }
    cout << “...." << endl;
  }
}


Compiler output:
a.cc:14:13: error: extended character “ is not valid in an identifier
   14 |     cout << “...." << endl;
      |             ^
a.cc:14:18: warning: missing terminating " character
   14 |     cout << “...." << endl;
      |                  ^
a.cc:14:18: error: missing terminating " character
   14 |     cout << “...." << endl;
      |                  ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:14:13: error: '\U0000201c' was not declared in this scope
   14 |     cout << “...." << endl;
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
    int k;
    cin >> k;
    string s;
    cin >> s;
    if(s.size() <= k){
        cout << s;
        return;
    }else{
        cout << s.substr(0,k) << "...";
        return;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   11 |         return;
      |         ^~~~~~
a.cc:14:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   14 |         return;
      |         ^~~~~~
Language: Java

import java.util.*;
class Main
{
  public static void main(String args[])
  {
    int K;
    Scanner in=new Scanner(System.in);
    K=in.nextInt();
    String S=in.next();
    int l=S.length();
    if(l<=K)
      System.out.println(S);
    else
    {
      String p=S.substring(0,K);
      p=p+"...";
      System.out.println(p);
    }
  }
        

Compiler output:
Main.java:19: error: reached end of file while parsing
  }
   ^
1 error
Language: C++

#include <iostream>
using namespace std;
#define MAX_SIZE 100

int main(){
  char* s
  int k;
  int cnt = 0;
  cin >> k;
  s = new char[MAX_SIZE];
  
  for(int i = 0; i < MAX_SIZE; i++) {
  	cin >> s[i];
    if(s[i]=="\n"||s[i]==EOF) break;
    cnt++;
  }
  
  if(cnt > k){
    for(int i = 0; i < k; i++)
      cout << s[i];
    cout << "..."<<endl;
  }
  else{
    for(int i = 0; i < k; i++)
      cout << s[i];
    cout << endl;
  }
  delete s;
 return 0; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'int'
    7 |   int k;
      |   ^~~
a.cc:9:10: error: 'k' was not declared in this scope
    9 |   cin >> k;
      |          ^
a.cc:10:3: error: 's' was not declared in this scope
   10 |   s = new char[MAX_SIZE];
      |   ^
a.cc:28:3: error: type '<type error>' argument given to 'delete', expected pointer
   28 |   delete s;
      |   ^~~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main{
int a;
string b; 
cin >> a ; 
cin >> b ; 
if(a==b.size()){
cout << b ;}
else
{
  
for(int i=0; i<a; i++)
  {cout << b[i];} 
  cout << "..." ;
}

}


Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:1: error: expected primary-expression before 'int'
    4 | int a;
      | ^~~
a.cc:4:1: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:6:1: error: 'cin' does not name a type
    6 | cin >> a ;
      | ^~~
a.cc:7:1: error: 'cin' does not name a type
    7 | cin >> b ;
      | ^~~
a.cc:8:1: error: expected unqualified-id before 'if'
    8 | if(a==b.size()){
      | ^~
a.cc:10:1: error: expected unqualified-id before 'else'
   10 | else
      | ^~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

#include<bits/stdc++.h>

using namespace std;


int main() {
  string s; cin >> s;
  if (s.size() > k) {
    cout << s.substr(0, k) << "..." << endl;
  }
  else {
    cout << s << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: 'k' was not declared in this scope
    8 |   if (s.size() > k) {
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int K;
  string S;
  cin >> K >> S ;
  K++;
  if(S.size()<K){
    cout << S << endl;
  }else{
    for(int i=0;i<K;i++){
      
      if((i+1)==K){
        cout << "..." << endl;
      }else{
        
      cout << S.at(i);
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#Include <bits/stdc++.h>
using namespace std;

int main(){
  int K;
  string S;
  cin >> K >> S ;
  K++;
  if(S.size()<K){
    cout << S << endl;
  }else{
    for(int i=0;i<K;i++){
      
      if((i+1)==K){
        cout << "..." << endl;
      }else{
        
      cout << S.at(i);
    }
  }
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #Include; did you mean #include?
    1 | #Include <bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string S;
      |   ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | #Include <bits/stdc++.h>
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> K >> S ;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #Include <bits/stdc++.h>
a.cc:7:15: error: 'S' was not declared in this scope
    7 |   cin >> K >> S ;
      |               ^
a.cc:10:5: error: 'cout' was not declared in this scope
   10 |     cout << S << endl;
      |     ^~~~
a.cc:10:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:18: error: 'endl' was not declared in this scope
   10 |     cout << S << endl;
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #Include <bits/stdc++.h>
a.cc:15:9: error: 'cout' was not declared in this scope
   15 |         cout << "..." << endl;
      |         ^~~~
a.cc:15:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:26: error: 'endl' was not declared in this scope
   15 |         cout << "..." << endl;
      |                          ^~~~
a.cc:15:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:18:7: error: 'cout' was not declared in this scope
   18 |       cout << S.at(i);
      |       ^~~~
a.cc:18:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;
int main{
long long int a,
string b; 
cin >> a ; 
cin >> b ; 
if(a==b.size()){
cout << b ;}
else
{
  
for(int i=0; i<a; i++)
  {cout << b[i];} 
  cout << "..." ;
}

}


Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:1: error: expected primary-expression before 'long'
    4 | long long int a,
      | ^~~~
a.cc:4:1: error: expected '}' before 'long'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:6:1: error: 'cin' does not name a type
    6 | cin >> a ;
      | ^~~
a.cc:7:1: error: 'cin' does not name a type
    7 | cin >> b ;
      | ^~~
a.cc:8:1: error: expected unqualified-id before 'if'
    8 | if(a==b.size()){
      | ^~
a.cc:10:1: error: expected unqualified-id before 'else'
   10 | else
      | ^~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
int a[100010];
int main(){
    int n, k;
    string s;
    while(cin>>k>>s){
        ll ans=0;
        if(k>=s.size()){
        	cout<<s<<endl;
        }
        else{
	        for(int i=0; i<k; ++i){
	        	cout<<s[i];
	        }
	        cout<<"...\n";
    	}
    }
  return 0;
}


#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
int a[100010];
int main(){
    int n, k;
    string s;
    while(cin>>k>>s){
        ll ans=0;
        if(k>=s.size()){
        	cout<<s<<endl;
        }
        else{
	        for(int i=0; i<k; ++i){
	        	cout<<s[i];
	        }
	        cout<<"...\n";
    	}
    }
  return 0;
}




Compiler output:
a.cc:35:5: error: redefinition of 'int a [100010]'
   35 | int a[100010];
      |     ^
a.cc:8:5: note: 'int a [100010]' previously declared here
    8 | int a[100010];
      |     ^
a.cc:36:5: error: redefinition of 'int main()'
   36 | int main(){
      |     ^~~~
a.cc:9:5: note: 'int main()' previously defined here
    9 | int main(){
      |     ^~~~
Language: C

#include <stdio.h>
int main()
{
  int i,k;
  int s[101];
  

  scanf("%d",&k);
  scanf("%s"s);

  for(i = 0;s[i] == '\0';i++){
    if(i < k+1)
    printf("%s",s);
    else{
    s[k] == '…';
    printf("%s",s);
  }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:13: error: expected ')' before 's'
    9 |   scanf("%s"s);
      |        ~    ^
      |             )
main.c:15:13: warning: multi-character character constant [-Wmultichar]
   15 |     s[k] == '…';
      |             ^~~
Language: C++


#include <bits/stdc++.h>
#include <string>
using namespace std;
int main(){
    int K;
    string str;
    cin>>K;
    cin>>str;
    int len;
    len= strlen(str);
    if(len<=K)
        cout<<K<<endl;
    else
    { for(int i=0;i<K;i++)
        {
            cout<<str[i];
        }
    cout<<"..."<<endl;
    
    }
return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   11 |     len= strlen(str);
      |                 ^~~
      |                 |
      |                 std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:2:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
Language: C

#include <stdio.h>
int main()
{
  int i,k;
  int s[101];
  

  scanf("%d",&k);
  scanf("%s"&s);

  for(i = 0;s[i] == '\0';i++){
    if(i < k+1)
    printf("%s",s);
    else{
    s[k] == '…';
    printf("%s",s);
  }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:13: error: invalid operands to binary & (have 'char *' and 'int *')
    9 |   scanf("%s"&s);
      |         ~~~~^
      |         |   |
      |         |   int *
      |         char *
main.c:15:13: warning: multi-character character constant [-Wmultichar]
   15 |     s[k] == '…';
      |             ^~~
Language: C++

#include<iostream>
using namespace std;int main{long long int a,string b; cin >> a ; cin >> b ; if(a==b.size()){


cout << b ;}
else
{
  for(int i=0; i<a; i++)
  {cout << b[i];} cout << "..." ;
}}


Compiler output:
a.cc:2:25: error: cannot declare '::main' to be a global variable
    2 | using namespace std;int main{long long int a,string b; cin >> a ; cin >> b ; if(a==b.size()){
      |                         ^~~~
a.cc:2:30: error: expected primary-expression before 'long'
    2 | using namespace std;int main{long long int a,string b; cin >> a ; cin >> b ; if(a==b.size()){
      |                              ^~~~
a.cc:2:30: error: expected '}' before 'long'
    2 | using namespace std;int main{long long int a,string b; cin >> a ; cin >> b ; if(a==b.size()){
      |                             ~^~~~
a.cc:2:56: error: 'cin' does not name a type
    2 | using namespace std;int main{long long int a,string b; cin >> a ; cin >> b ; if(a==b.size()){
      |                                                        ^~~
a.cc:2:67: error: 'cin' does not name a type
    2 | using namespace std;int main{long long int a,string b; cin >> a ; cin >> b ; if(a==b.size()){
      |                                                                   ^~~
a.cc:2:78: error: expected unqualified-id before 'if'
    2 | using namespace std;int main{long long int a,string b; cin >> a ; cin >> b ; if(a==b.size()){
      |                                                                              ^~
a.cc:6:1: error: expected unqualified-id before 'else'
    6 | else
      | ^~~~
a.cc:10:2: error: expected declaration before '}' token
   10 | }}
      |  ^
Language: Java

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner sc=new Scanner(System.in);
		int k=sc.nextInt();
		String s=sc.next();
		if(s.length()>k)
		{
			for(int i=0;i<k;i++)
			{
				System.out.print(s.charAt(i));
			}
			System.out.print("...");
		}
		else
		{
			System.out.println(s);
		}
	}
}

Compiler output:
Main.java:8: error: class Ideone is public, should be declared in a file named Ideone.java
public class Ideone
       ^
1 error
Language: C++


#include <bits/stdc++.h>
using namespace std;
int main(){
    int K;
    string str;
    cin>>K;
    cin>>str;
    int len;
    len= strlen(str);
    if(len<=K)
        cout<<K<<endl;
    else
    { for(int i=0;i<K;i++)
        {
            cout<<str[i];
        }
    cout<<"..."<<endl;
    
    }
return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   10 |     len= strlen(str);
      |                 ^~~
      |                 |
      |                 std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:2:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int K;cin >> K;
  string str;cin >> str;
  if (str.size<=K){
    cout << str << endl;
  }
  else {
    for (int i=0;i<K;i++){
      cout << str.at(i);
    }
    cout << "…" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    7 |   if (str.size<=K){
      |       ~~~~^~~~
      |               ()
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main()
{
    string s;
    int k;
    cin>>k;
    cin>>s;
    int len=s.length();
    if(len<=k)
        cout<<s<<endl;
    else
    {
        for(int j=0;j<k;j++)
            cout<<s[j];
        cout<<"...";
    }
    return 0;
}
#include<iostream>
#include<string>
using namespace std;
int main()
{
    string s;
    int k;
    cin>>k;
    cin>>s;
    int len=s.length();
    if(len<=k)
        cout<<s<<endl;
    else
    {
        for(int j=0;j<k;j++)
            cout<<s[j];
        cout<<"...";
    }
    return 0;
}


Compiler output:
a.cc:24:5: error: redefinition of 'int main()'
   24 | int main()
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main()
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
   unsigned int K;
   string S;
   cin >> K >> S;
   if(K >= S.size()){
   cout << S <<endl;
   }
   if{K < S.size()}{
   cout << S.substr(1, K) + "..." <<endl;
   }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:6: error: expected '(' before '{' token
   11 |    if{K < S.size()}{
      |      ^
      |      (
Language: C++

#include<iostream>using namespace std;int main{long long int a,string b; cin >> a ; cin >> b ; if(a==b.size()){


cout << b ;
}
else
{
  for(int i=0; i<a; i++)
  {cout << b[i];} cout << "..." ;
}}

Compiler output:
a.cc:1:25: warning: extra tokens at end of #include directive
    1 | #include<iostream>using namespace std;int main{long long int a,string b; cin >> a ; cin >> b ; if(a==b.size()){
      |                         ^~~~~~~~~
a.cc:1:9: fatal error: iostream>usin: No such file or directory
    1 | #include<iostream>using namespace std;int main{long long int a,string b; cin >> a ; cin >> b ; if(a==b.size()){
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int K;
  string S;
  cin >> K >> S;
    if (S.size() > K) {
      for (int i =0; i < K; i++{
        cout << S.at(i) << i << "..." << endl;
      }
           }
  	if (S.size() =< K) {
      cout << S << endl;
    } 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:32: error: expected ')' before '{' token
    9 |       for (int i =0; i < K; i++{
      |           ~                    ^
      |                                )
a.cc:13:23: error: expected primary-expression before '<' token
   13 |         if (S.size() =< K) {
      |                       ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define vec(j,n) vector<int>(j(n))
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using P = pair<int,int>;


int main(){
    string s,ans;
    int k;
    cin >> k;#
  	cin >> s;
    int ss = s.size();
    if(ss <= k){
      cout << s << endl;
      return 0;
    }else if(ss > k){
      for (int i=0 ;i < k;i++){
        ans += s[i];
      }
    }
    cout << ans << "..." << endl;
    return 0;
}

Compiler output:
a.cc:13:14: error: stray '#' in program
   13 |     cin >> k;#
      |              ^
Language: C

#include <stdio.h>
int main()
{
  int i,k;
  int s[101];
  

  scanf("%d",&k);
  scanf("%s"&s);

  for(i = 0;s[i] != '\0';++i){
    if(i <= k+1)
    printf("%s",s);
    else{
    s[k+1] == '…';
    printf("%s",s[k+1]);
  }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:13: error: invalid operands to binary & (have 'char *' and 'int *')
    9 |   scanf("%s"&s);
      |         ~~~~^
      |         |   |
      |         |   int *
      |         char *
main.c:15:15: warning: multi-character character constant [-Wmultichar]
   15 |     s[k+1] == '…';
      |               ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int K;
  string S;
  cin >> K >> S;
    if (S.size()>K){
      for (int i =0; i < K; i++{
        cout << S.at(i) << i << "..." << endl;
    }
  	if (S.size()=<K){
      cout << S << endl;
    } 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:32: error: expected ')' before '{' token
    9 |       for (int i =0; i < K; i++{
      |           ~                    ^
      |                                )
a.cc:12:22: error: expected primary-expression before '<' token
   12 |         if (S.size()=<K){
      |                      ^
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>

#include <cstring>

using namespace std;

char s[100005];

int main(){

	int t;

	cin>>t;

	scanf(" ");

	gets(s);

	if(t>=strlen(s)) puts(s);

	else{

		s[t]='\0';

		printf("%s",s);

		puts("...");

	}

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   17 |         gets(s);
      |         ^~~~
      |         getw
Language: C

#include <bits/stdc++.h>
using namespace std;
 
int main() {
string s;
int k;
cin >> k;
cin >> s;
int nagasa;
  nagasa = s.size();
  
  if(nagasa <= k)
  {
    cout << s << endl;
  }
  else
  {
    for(int i=0; i<k; i++)
    {
      cout << s[i];
    }
    cout << "..." << endl;
  }
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
int n, x, c, i=0;
char s[105];
int main(){
	scanf("%d", &n);
	scanf("%s", s);
	for(i=0; i<=strlen's'; i++){
		printf("%c" s[i]);
	}
	printf("...");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |         for(i=0; i<=strlen's'; i++){
      |                  ~^~~~~~~~
a.cc:8:27: error: expected ';' before 's'
    8 |         for(i=0; i<=strlen's'; i++){
      |                           ^~~
      |                           ;
a.cc:8:30: error: expected ')' before ';' token
    8 |         for(i=0; i<=strlen's'; i++){
      |            ~                 ^
      |                              )
a.cc:8:35: error: expected ';' before ')' token
    8 |         for(i=0; i<=strlen's'; i++){
      |                                   ^
      |                                   ;
Language: C++

    #include <iostream>
    #include <cstring>
    using namespace std;
     
    int main () {
     int num;
     int s_size 
     string s;
     
     cin >> num;
     cin >> s;
     s_size = s.length();
      
     if (num >= s_size) {
      cout << s << endl; 
     } else { 
      for (int i = 0; i < num; i++) {
       cout << s[i];  
      }
      cout <<  "..." << endl;
     }
      
     return 0; 
    }

#include <iostream>
#include <cstring>
using namespace std;

int main () {
 int num;
 int s_size; 
 string s;
 
 cin >> num;
 cin >> s;
 s_size = s.length();
  
 if (num >= s_size) {
  cout << s << endl; 
 } else { 
  for (int i = 0; i < num; i++) {
   cout << s[i];  
  }
  cout <<  "..." << endl;
 }
  
 return 0; 
}

提出情報
提出日時 	

Compiler output:
a.cc: In function 'int main()':
a.cc:8:6: error: expected initializer before 'string'
    8 |      string s;
      |      ^~~~~~
a.cc:11:13: error: 's' was not declared in this scope
   11 |      cin >> s;
      |             ^
a.cc:12:6: error: 's_size' was not declared in this scope; did you mean 'dysize'?
   12 |      s_size = s.length();
      |      ^~~~~~
      |      dysize
a.cc: At global scope:
a.cc:30:5: error: redefinition of 'int main()'
   30 | int main () {
      |     ^~~~
a.cc:5:9: note: 'int main()' previously defined here
    5 |     int main () {
      |         ^~~~
a.cc:51:1: error: '\U000063d0\U000051fa\U000060c5\U00005831' does not name a type
   51 | 提出情報
      | ^~~~~~~~
Language: C

#include <bits/stdc++.h>
using namespace std;
 
int main() {
string s;
int k;
cin >> k;
cin >> s;
int nagasa;
  nagasa = s.size();
  
  if(nagasa <= k)
  {
    cout << s << endl;
  }
  else
  {
    for(int i=0; i<k; i++)
    {
      cout << s[i];
    }
    cout << "..." << endl;
  }

  
  
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int K;
  string S;
  cin >> K >> S;
  int N = S.size();
  string STR = '';
  if (N <= K)
    cout << S << endl;
  else {
    for (int i = 0; i < K; i++)
      STR += S.at(i);
    cout << STR << "..." << endl;
  }
}

Compiler output:
a.cc:9:16: error: empty character constant
    9 |   string STR = '';
      |                ^~
a.cc: In function 'int main()':
a.cc:9:16: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
Language: C

#include <stdio.h>

int main(int argc, char** argv)
{
	char s[105];
	int k, n = -1;
	scanf("%d%s", &k, s);
	while(true)
	{
		if(++n >= k)
		{
			puts("...");
			return 0;
		}
		if(s[n] == '\0') return 0;
		putchar(s[n]);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:15: error: 'true' undeclared (first use in this function)
    8 |         while(true)
      |               ^~~~
main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c:8:15: note: each undeclared identifier is reported only once for each function it appears in
    8 |         while(true)
      |               ^~~~
Language: C++

#include <iostream>

#include <cstring>

using namespace std;

char s[100005];

int main(){

	int t;
	cin>>t;

	scanf(" ");

	gets(s);

	if(t>=strlen(s)) puts(s);

	else{

		s[t]='\0';

		printf("%s",s);

		puts("...");

	}

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   16 |         gets(s);
      |         ^~~~
      |         getw
Language: C++

#include <iostream>
#include <cstring>
using namespace std;

int main () {
 int num;
 int s_size 
 string s;
 
 cin >> num;
 cin >> s;
 s_size = s.length();
  
 if (num >= s_size) {
  cout << s << endl; 
 } else { 
  for (int i = 0; i < num; i++) {
   cout << s[i];  
  }
  cout <<  "..." << endl;
 }
  
 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:2: error: expected initializer before 'string'
    8 |  string s;
      |  ^~~~~~
a.cc:11:9: error: 's' was not declared in this scope
   11 |  cin >> s;
      |         ^
a.cc:12:2: error: 's_size' was not declared in this scope; did you mean 'dysize'?
   12 |  s_size = s.length();
      |  ^~~~~~
      |  dysize
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// スペース区切りの整数の入力
		String moji = sc.nextLine();
      　int kazu=sc.nextInt();
      if(moji.length()<=kazu){
        System.out.println(moji);
      }else{
        System.out.println(moji.substring(0,kazu));
      }
}
}

Compiler output:
Main.java:7: error: illegal character: '\u3000'
      ?int kazu=sc.nextInt();
      ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int a;
	string b;
	cin>>a>>b;
	if (a.size()<=a)
		cout<<b;
	else
		for (int i=0;i<a;i++)
			cout<<"...";
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: request for member 'size' in 'a', which is of non-class type 'int'
    8 |         if (a.size()<=a)
      |               ^~~~
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// スペース区切りの整数の入力
		String moji = sc.nextLine();
int kazu=sc.nextInt();
      if(moji.length<=kazu){
        System.out.println(moji);
      }else{
        System.out.println(moji.substring(0,kazu));
      }
}
}

Compiler output:
Main.java:8: error: cannot find symbol
      if(moji.length<=kazu){
             ^
  symbol:   variable length
  location: variable moji of type String
1 error
Language: Java

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner sc=new Scanner(System.in);
		int k=sc.nextInt();
		String s=sc.next();
		if(s.length()>k)
		{
			for(int i=0;i<k;i++)
			{
				System.out.print(s.charAt(i));
			}
			System.out.print("...");
		}
		else
		{
			System.out.println(s);
		}
	}
}

Compiler output:
Main.java:2: error: class Ideone is public, should be declared in a file named Ideone.java
public class Ideone
       ^
Main.java:7: error: cannot find symbol
		Scanner sc=new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Ideone
Main.java:7: error: cannot find symbol
		Scanner sc=new Scanner(System.in);
		               ^
  symbol:   class Scanner
  location: class Ideone
3 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// スペース区切りの整数の入力
		String moji = sc.nextLine();
      　int kazu=sc.nextInt();
      if(moji.length<=kazu){
        System.out.println(moji);
      }else{
        System.out.println(moji.substring(0,kazu));
      }
}
}

Compiler output:
Main.java:7: error: illegal character: '\u3000'
      ?int kazu=sc.nextInt();
      ^
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);

	string s;
	int l;
	cin >> l;
	cin >> s;
	debug(s.length());
	if (s.length() - 1 > l) {
		for (int i = 0; i < l; i++) {
			cout << s[i];
		}cout << "...\n";
	}
	else {
		cout << s << "\n";
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'debug' was not declared in this scope
   13 |         debug(s.length());
      |         ^~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
#define MAX_SIZE 100

int main(){
  string s;
  int k;
  cin >> k;
  cin >> s;
  
  if(s.length()>k){
    for(int i = 0; i < k; i++)
      cout << s.[i];
    cout << "..."<<endl;
  }
  else{
    for(int i = 0; i < k; i++)
      cout << s.[i];
  }
 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: expected unqualified-id before '[' token
   14 |       cout << s.[i];
      |                 ^
a.cc:19:17: error: expected unqualified-id before '[' token
   19 |       cout << s.[i];
      |                 ^
Language: Java


import java.io.*;
import java.util.*;
public class Main{


public static void main(String[] args) {
	Scanner sc=new Scanner(System.in);
	int k=sc.nextInt();
	String s=sc.nextInt();
  	int n=s.length();
	if(n<=k)
		System.out.println(s);
  	else
      	System.out.println(s.substring(0,k+1)+"...");
	
		
}

}


Compiler output:
Main.java:10: error: incompatible types: int cannot be converted to String
	String s=sc.nextInt();
	                   ^
1 error
Language: C

#include<stdio.h>
#include<string.h>
int main(){
int K,a=0;
char S[100];
  scanf("%d",&K);
  fflush(stdin);
  gets(S);
  for(int i=0;i<strlen(S);i++){
  if(S[i]>="a"&&S[i]<="z")
    a=1;
  }
  if(strlen(S)>=K&&a=1)
    printf("%s",S);
  else if(strlen(S)>K){
    strcat(S,"...");
    printf("%s",S);}
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:3: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    8 |   gets(S);
      |   ^~~~
      |   fgets
main.c:10:10: warning: comparison between pointer and integer
   10 |   if(S[i]>="a"&&S[i]<="z")
      |          ^~
main.c:10:21: warning: comparison between pointer and integer
   10 |   if(S[i]>="a"&&S[i]<="z")
      |                     ^~
main.c:13:21: error: lvalue required as left operand of assignment
   13 |   if(strlen(S)>=K&&a=1)
      |                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fr(i,j,k) for(int i=j;i<k;i++)
#define f(n) fr(i,0,n)
#define f1(n) fr(i,1,n+1)
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
using namespace std;
const int maxn = 10000005;
const int mod = 998244353;
const int mx = 2e9;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    string s;
    cin >> s >> s;
    if (s.size() <= k) {
        cout << s << endl;
    }
    else {
        for (int i = 7 ; i < s.size(); i ++) {
            s[i] = '.';
        }
        cout << s << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:21: error: 'k' was not declared in this scope
   21 |     if (s.size() <= k) {
      |                     ^