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

/****************************************
	Sahil Gangurde
	Learning through WA, TLE, SIGESV
****************************************/
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <fstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <utility>
#include <climits>
#include <numeric>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <cassert>
using namespace std;
typedef long long ll;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ll n;
	cin>>n;
	string s;
	cin>>s;
	if(s.length()>n) {
		for(ll i=0; i<k; i++) {
			cout<<s[i];
		}
	}
	else {
		cout<<s;
	}
	return 0;
}


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

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

int K = 0;

string S;
string m = "...";

int main(){
  
  cin>>K;
  
  cin>>S;
  
  
  if(S.length() > K){
    
    string nS = S.substr(0,K);
    nS += m;
    
    cout<<nS;
  }else{
    cout<<S;
  
  }
  

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

import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class sample {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		 int K = sc.nextInt();
		 String S = sc.next();
		 Pattern p = Pattern.compile("^[a-z]+$");
		 Matcher m = p.matcher(S);
		 boolean b = m.find();

		 //文字が英字かどうか
		 if(b){
			 if(1<=K && K<=100) {

				 if(1<=S.length() && S.length()<=100) {

					 if(S.length() >= K) {

						 System.out.println(S.substring(0,K)+ "...");
					 }
					 else if(S.length() <= K) {

						 System.out.println(S);
					 }

				 }
			 }
		 }
		 sc.close();		
	}
}

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

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>

using namespace std;
using ll == long long;

int main(){
cin.tie(0);
string n;
int k;
cin >> k;
cin >> n;

if(n.size()<=k)cout << n;
else{
 for(int i=0;i<k;i++){
  string n2;
   n2.push_back(n[i]);
   n2+="...";
   cout << n2;
 }
}
return 0;
}

Compiler output:
a.cc:7:7: error: expected nested-name-specifier before 'll'
    7 | using ll == long long;
      |       ^~
Language: Java

import java.util.*;
class Main {

  static Integer[] PON_ARR = new Integer[]{0,1,6,8};
  static  Integer[] BON_ARR = new Integer[]{3};
  static  List<Integer> PON_LIST = Arrays.asList(PON_ARR);
  static  List<Integer> BON_LIST = Arrays.asList(BON_ARR);

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int k = sc.nextInt();
    String s = sc.nextString();
    
    int lenS = s.length();
    
    if( lenS > k ) {
        SYstem.out.println( s.substr(0, k) + "...");    
    }else{
        SYstem.out.println( s );    
    }
  }
}


Compiler output:
Main.java:12: error: cannot find symbol
    String s = sc.nextString();
                 ^
  symbol:   method nextString()
  location: variable sc of type Scanner
Main.java:17: error: cannot find symbol
        SYstem.out.println( s.substr(0, k) + "...");    
                             ^
  symbol:   method substr(int,int)
  location: variable s of type String
Main.java:17: error: package SYstem does not exist
        SYstem.out.println( s.substr(0, k) + "...");    
              ^
Main.java:19: error: package SYstem does not exist
        SYstem.out.println( s );    
              ^
4 errors
Language: Java

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		 int K = sc.nextInt();
		 String S = sc.next();

		 //大文字を小文字に変換
		 S = S.toLowerCase();
		 if(1<=K && K<=100) {

			 if(1<=S.length() && S.length()<=100) {

				 if(S.length() >= K) {

					 System.out.println(S.substring(0,K)+ "...");
				 }
				 else if(S.length() <= K) {

					 System.out.println(S);
				 }

			 }
		 }

	}
}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <string>
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <math.h>
 
using namespace std;
int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
 
	int x,y;
    string s;
	cin >> x >> s;
    y = s.size();
    if(x>y){for(int i=0;i<y;i++){cout << s[i];}cout << "..."}else{cout << s;}
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:61: error: expected ';' before '}' token
   18 |     if(x>y){for(int i=0;i<y;i++){cout << s[i];}cout << "..."}else{cout << s;}
      |                                                             ^
      |                                                             ;
Language: Java

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        var kNum = Integer.parseInt(scanner.nextLine());
        var s = scanner.nextLine();
        var sNum = Integer.parseInt(s);

        if (sNum <= kNum) {
            System.out.println(s);
        } else {
            System.out.println(s.substring(0, kNum) + "...");
        }
    }
}


Compiler output:
Main.java:3: error: cannot find symbol
        Scanner scanner = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner scanner = new Scanner(System.in);
                              ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

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

Compiler output:
Main.java:8: error: ';' expected
    	S = S.toLowerCase()
    	                   ^
1 error
Language: Java

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

Compiler output:
Main.java:7: error: cannot find symbol
    	String S = scan.nextString();
    	               ^
  symbol:   method nextString()
  location: variable scan of type Scanner
1 error
Language: Java

import java.util.Scanner;
class Main{
  public static void main(String args[]){
    Scanner scan = new Scanner(System.in);
    	
    	int K = scan.nextInt();
    	String S = scan.nextString();
    	
    	if(S.length()>K){
        	S = S.substring(0,K);
        	System.out.println(S);
        
        }
  	}
  }

Compiler output:
Main.java:7: error: cannot find symbol
    	String S = scan.nextString();
    	               ^
  symbol:   method nextString()
  location: variable scan of type Scanner
1 error
Language: Java

import java.util.Scanner;
class Main{
  public static void main(String args[]){
    Scanner scan = new Scanner(System.in);
    	
    	int K = sc.nextInt();
    	String S = sc.nextString();
    	
    	if(S.length>K){
        	S = S.substring(0,K);
        	System.out.println(S);
        
        }
    
  }
}  
    

Compiler output:
Main.java:6: error: cannot find symbol
    	int K = sc.nextInt();
    	        ^
  symbol:   variable sc
  location: class Main
Main.java:7: error: cannot find symbol
    	String S = sc.nextString();
    	           ^
  symbol:   variable sc
  location: class Main
Main.java:9: error: cannot find symbol
    	if(S.length>K){
    	    ^
  symbol:   variable length
  location: variable S of type String
3 errors
Language: Java

import java.util.Scanner;
class Main{
  public static void main(String args[]){
    Scanner scan = new Scanner(System.in);
    	
    	int K = sc.nextInt();
    	String S = sc.nextString();
    	
    	if(S.length>K){
        	S = S.substring(0,K)
        	System.out.println(S);
        
        }
    
  }
}  
    

Compiler output:
Main.java:10: error: ';' expected
        	S = S.substring(0,K)
        	                    ^
1 error
Language: Java

import java.util.Scanner;
class Main{
  public static void main(String args[]){
    Scanner scan = new Scanner(System.in);
    	
    	int K = sc.nextInt();
    	String S = sc.nextString();
    	
    	if(S.length>K){
        
        
        
        
        
        }
    
  }
}  
    

Compiler output:
Main.java:6: error: cannot find symbol
    	int K = sc.nextInt();
    	        ^
  symbol:   variable sc
  location: class Main
Main.java:7: error: cannot find symbol
    	String S = sc.nextString();
    	           ^
  symbol:   variable sc
  location: class Main
Main.java:9: error: cannot find symbol
    	if(S.length>K){
    	    ^
  symbol:   variable length
  location: variable S of type String
3 errors
Language: C++

#include <bits/stdc++.h>
#include <unordered_map> 
using namespace std; 
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define PI1 3.14159265358979311599796346854418516159057617187500

typedef long long int ll;  
ll MOD = 1e9 + 7;


int main() 
{ 
    FIO
    int t;
    t = 1;
    while(t--)
    {
        int k
        cin >> k;
        string s;
        cin >> s;

        if((int)s.length()<=k)
        {
            cout << s << endl;
            continue;
        }
        for(int i=0;i<k;i++)
            cout << s[i];
        cout << "...";
    }
    return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: expected initializer before 'cin'
   19 |         cin >> k;
      |         ^~~
a.cc:23:29: error: 'k' was not declared in this scope
   23 |         if((int)s.length()<=k)
      |                             ^
a.cc:28:23: error: 'k' was not declared in this scope
   28 |         for(int i=0;i<k;i++)
      |                       ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: no matching function for call to 'min(int&, std::__cxx11::basic_string<char>::size_type)'
    7 | for(int i=0;i<min(k,s.length());++i) {
      |               ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:7:18: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
    7 | for(int i=0;i<min(k,s.length());++i) {
      |               ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:7:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
    7 | for(int i=0;i<min(k,s.length());++i) {
      |               ~~~^~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#define ll int
#define ld long double
#define fs first
#define sc second
#define task "tet"
using namespace std;
const ll N = 1e6 + 9;
const ll inf = 1e9 + 7;
typedef pair<ll,ll> LL;

ll k;
string s;
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    if (fopen(task".inp", "r")){
        freopen(task".inp", "r", stdin);
        //freopen(task".out", "w", stdout);
    }
    cin>>k>>s;
    ll n = s.size();
    if (n <= k) cout<<s;
    else{
        for (i = 0;i < k;i++) cout<<s[i];
        cout<<"...";
    }
}


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

#include <cstdio>
#include <string>
#include <iostream>

using namespace std;

int main(void){
    int K;
    string S;
    cin >> K;
    cin >> S;
    if(s.length()<=K) cout<<S<<"\n";
    else {
        for(int i = 0; i < K; i++) {
            printf("%c", s[i]);
        }
        printf("...\n");
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:8: error: 's' was not declared in this scope
   12 |     if(s.length()<=K) cout<<S<<"\n";
      |        ^
Language: C++

#if __has_include("noamoa_atcoder_lib.h")
#include "noamoa_atcoder_lib.h"
#endif

int main(){
	cout << fixed << setprecision(20);



	int K;
	string S;

	cin>>K;
	cin>>S;
	cout << (S.size()<=K?S:(S.substr(0, K))+"...");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cout' was not declared in this scope
    6 |         cout << fixed << setprecision(20);
      |         ^~~~
a.cc:6:17: error: 'fixed' was not declared in this scope
    6 |         cout << fixed << setprecision(20);
      |                 ^~~~~
a.cc:6:26: error: 'setprecision' was not declared in this scope
    6 |         cout << fixed << setprecision(20);
      |                          ^~~~~~~~~~~~
a.cc:11:9: error: 'string' was not declared in this scope
   11 |         string S;
      |         ^~~~~~
a.cc:13:9: error: 'cin' was not declared in this scope
   13 |         cin>>K;
      |         ^~~
a.cc:14:14: error: 'S' was not declared in this scope
   14 |         cin>>S;
      |              ^
Language: Java

import java.util.Scanner;

public class KaranTandonKicks{

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

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

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

#define RAPIDA ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: 'k' was not declared in this scope
   10 |     if(s.length()<=k)
      |                    ^
Language: Java

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


Compiler output:
Main.java:7: error: cannot find symbol
    if(s.length<n){
        ^
  symbol:   variable length
  location: variable s of type String
1 error
Language: Java

import java.util.*;
public class Main{
  public static void main(String[]args){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    String s=sc.next();
    if(s.length<n){
      System.out.println(s);
    }else{
      System.out.println(s.substring(1,n));
    }
  }
}
    

Compiler output:
Main.java:7: error: cannot find symbol
    if(s.length<n){
        ^
  symbol:   variable length
  location: variable s of type String
1 error
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: 'll' was not declared in this scope
   11 |                 for(ll i=0;i<k;i++)cout<<s[i];
      |                     ^~
a.cc:11:28: error: 'i' was not declared in this scope
   11 |                 for(ll i=0;i<k;i++)cout<<s[i];
      |                            ^
Language: C++

 mod 998244353
#define MAXN 998244353
#define INF 1e18
using namespace std;
bool sortbysec(const pair<int,int> &a,
              const pair<int,int> &b)
{
    return (a.F<b.F);
}
string a,b,c;
ll dp[210][210][210];
int main(){
    //memset(dp,-1,sizeof dp);
    ll t,n,i,j,k;
    cin>>k;
    string s,s1;
    cin>>s;
    if(s.size()<=k) cout<<s;
    else{
        for(i=0;i<k;i++){
            s1+=s[i];
        }
        s+=s1;
        cout<<s;
    }
 }


Compiler output:
a.cc:1:2: error: 'mod' does not name a type
    1 |  mod 998244353
      |  ^~~
a.cc:5:22: error: 'pair' does not name a type
    5 | bool sortbysec(const pair<int,int> &a,
      |                      ^~~~
a.cc:5:26: error: expected ',' or '...' before '<' token
    5 | bool sortbysec(const pair<int,int> &a,
      |                          ^
a.cc: In function 'bool sortbysec(int)':
a.cc:8:13: error: 'a' was not declared in this scope
    8 |     return (a.F<b.F);
      |             ^
a.cc:8:17: error: 'b' was not declared in this scope
    8 |     return (a.F<b.F);
      |                 ^
a.cc: At global scope:
a.cc:10:1: error: 'string' does not name a type
   10 | string a,b,c;
      | ^~~~~~
a.cc:11:1: error: 'll' does not name a type
   11 | ll dp[210][210][210];
      | ^~
a.cc: In function 'int main()':
a.cc:14:5: error: 'll' was not declared in this scope
   14 |     ll t,n,i,j,k;
      |     ^~
a.cc:15:5: error: 'cin' was not declared in this scope
   15 |     cin>>k;
      |     ^~~
a.cc:15:10: error: 'k' was not declared in this scope
   15 |     cin>>k;
      |          ^
a.cc:16:5: error: 'string' was not declared in this scope
   16 |     string s,s1;
      |     ^~~~~~
a.cc:17:10: error: 's' was not declared in this scope
   17 |     cin>>s;
      |          ^
a.cc:18:21: error: 'cout' was not declared in this scope
   18 |     if(s.size()<=k) cout<<s;
      |                     ^~~~
a.cc:20:13: error: 'i' was not declared in this scope
   20 |         for(i=0;i<k;i++){
      |             ^
a.cc:21:13: error: 's1' was not declared in this scope
   21 |             s1+=s[i];
      |             ^~
a.cc:23:12: error: 's1' was not declared in this scope
   23 |         s+=s1;
      |            ^~
a.cc:24:9: error: 'cout' was not declared in this scope
   24 |         cout<<s;
      |         ^~~~
Language: Java

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

Compiler output:
Main.java:6: error: cannot find symbol
    sc.nextline();
      ^
  symbol:   method nextline()
  location: variable sc of type Scanner
Main.java:7: error: cannot find symbol
    String S = sc.nextline();
                 ^
  symbol:   method nextline()
  location: variable sc of type Scanner
2 errors
Language: Java

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

Compiler output:
Main.java:6: error: ';' expected
    sc.nextline()
                 ^
1 error
Language: Java

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

Compiler output:
Main.java:6: error: cannot find symbol
    String S = sc.nextline();
                 ^
  symbol:   method nextline()
  location: variable sc of type Scanner
1 error
Language: Java

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

Compiler output:
Main.java:6: error: cannot find symbol
    String S = sc.nextline();
                 ^
  symbol:   method nextline()
  location: variable sc of type Scanner
Main.java:7: error: cannot find symbol
    if(K>=sc.length()){
            ^
  symbol:   method length()
  location: variable sc of type Scanner
2 errors
Language: Java

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

Compiler output:
Main.java:5: error: non-static variable sc cannot be referenced from a static context
    int K = sc.nextInt();
            ^
Main.java:6: error: non-static variable sc cannot be referenced from a static context
    String S = sc.nextline();
               ^
Main.java:6: error: cannot find symbol
    String S = sc.nextline();
                 ^
  symbol:   method nextline()
  location: variable sc of type Scanner
Main.java:7: error: non-static variable sc cannot be referenced from a static context
    if(K>=sc.length()){
          ^
Main.java:7: error: cannot find symbol
    if(K>=sc.length()){
            ^
  symbol:   method length()
  location: variable sc of type Scanner
5 errors
Language: C++

#include <iostream>
#include <stdlib.h>
using namespace std;
//int main(int argc, char* argv[]){
int main(){
	int K;//文字数
  	int length;
 	string str1;
  	string str2;
  	cin>>str1;//数字
  	cin>>str2;
  	K = atoi(str1);
  	length = str2.length();
  	str2.erase(K+1);//K文字目以降の文字列を削除
	cout << str2;
  	if(length > K){
      cout << "..." << endl;
    }else {
      cout << endl;
    }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   12 |         K = atoi(str1);
      |                  ^~~~
      |                  |
      |                  std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 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,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
 
int main(){
	int k;
    cin >> k;
  	string s;
  	if((int)s.length() <= k){
    	cout << s;
    }
  	else {
    	s = s.substr(0, k) + "...";
      	cout << s ;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:15:6: error: expected '}' at end of input
   15 |     }
      |      ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: Java

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


Compiler output:
Main.java:12: error: ';' expected
      System.out.println(s.substring(0,k+1)+"..."));
                                                  ^
1 error
Language: C++

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

int main(){
  int N;
  string s;
  cin >> N; cin >> s;
  if(s.size()>N){
    for(int i=0;i<N;++i){
      printf("%c",s[i]);
    }
    printf("...");
  }
  else{
	for(int i=0;i<s.size();++i) printf("%c",s[i]);
  }
  
  return 0;
  
  

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

#include <iostream>
#include <stdio.h>

int main()
{
  	uint64_t K;
    string S;
 
  	std::cin >> K >> S;
  
  	if (S.size() <= K)
    	std::cout << S;
  	else
      	std::cout << S.substr(0, K) << "...";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'uint64_t' was not declared in this scope
    6 |         uint64_t K;
      |         ^~~~~~~~
a.cc:2:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    1 | #include <iostream>
  +++ |+#include <cstdint>
    2 | #include <stdio.h>
a.cc:7:5: error: 'string' was not declared in this scope
    7 |     string S;
      |     ^~~~~~
a.cc:7:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:9:21: error: 'K' was not declared in this scope
    9 |         std::cin >> K >> S;
      |                     ^
a.cc:9:26: error: 'S' was not declared in this scope
    9 |         std::cin >> K >> S;
      |                          ^
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main() {
	int K;
	char S[101] = "";
	char c;
	cin >> K;
	cin >> S;
	if (strlen(S) <= K ) {
		cout << S << endl;
	}
	else {
		S[K] = '\0';
		cout << S << "..." << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'strlen' was not declared in this scope
   10 |         if (strlen(S) <= K ) {
      |             ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | #include<string>
Language: C++

///=======================///
/// coder: Andy - Tohrumi ///
///=======================///

#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define fastio ios_base::sync_with_stdio(); cin.tie(0); cout.tie(0);
#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define rep(i, a, b) for(__typeof(b) i = a; i < b; i++)
#define Rep(i, a, b) for(__typeof(a) i = a; i > b; i--)
	
using namespace std;

typedef pair<ll, ll> pll;	typedef pair<int, int> ii;
typedef vector<pll> vll;	typedef vector<string> vs;		typedef vector<ii> vii;
typedef vector<int> vi; 	typedef vector<ll> vl;

///=====code start here=====///

signed main() {
	fastio;
	int k; string s; cin >> k >> s;
	int n = s.length();
	rep(i, 0, min(k, n)) {
		cout << s[i];
	}
	if(n > k) cout << "...";
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:13: error: increment of read-only variable 'i'
   27 |         rep(i, 0, min(k, n)) {
      |             ^
a.cc:12:52: note: in definition of macro 'rep'
   12 | #define rep(i, a, b) for(__typeof(b) i = a; i < b; i++)
      |                                                    ^
Language: Java

private class Main {

Scnanner snNum = new Scnanner(System.in);
Scnanner snRead = new Scnanner(System.in);

int iSnNum = Integer.parseInt(snNum);

if (iSnNum < snRead.length()) {

    snRead = snRead.subString(0, iSnNum);
} else {
    snRead;
}

System.out.print(snRead);

Compiler output:
Main.java:8: error: illegal start of type
if (iSnNum < snRead.length()) {
^
Main.java:8: error: > or ',' expected
if (iSnNum < snRead.length()) {
                          ^
Main.java:8: error: ';' expected
if (iSnNum < snRead.length()) {
                            ^
Main.java:11: error: illegal start of type
} else {
  ^
Main.java:12: error: not a statement
    snRead;
    ^
Main.java:15: error: <identifier> expected
System.out.print(snRead);
                ^
Main.java:15: error: <identifier> expected
System.out.print(snRead);
                       ^
Main.java:15: error: reached end of file while parsing
System.out.print(snRead);
                         ^
8 errors
Language: C++

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


Compiler output:
a.cc:13:11: warning: multi-character character constant [-Wmultichar]
   13 |     cout<<'...';
      |           ^~~~~
a.cc: In function 'int main()':
a.cc:8:8: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    8 |   if(s.length<=k)
      |      ~~^~~~~~
      |              ()
Language: C++

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

Compiler output:
a.cc:13:11: warning: multi-character character constant [-Wmultichar]
   13 |     cout<<'...';
      |           ^~~~~
a.cc: In function 'int main()':
a.cc:8:8: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    8 |   if(s.length<=k)
      |      ~~^~~~~~
      |              ()
a.cc:11:9: error: 'll' was not declared in this scope
   11 |     for(ll i=0;i<k;i++)
      |         ^~
a.cc:11:16: error: 'i' was not declared in this scope
   11 |     for(ll i=0;i<k;i++)
      |                ^
Language: Java

import java.util.*;

public class Main{
	int N;
	Scanner reader = new Scanner(System.in);
	public static void main(String[]args) {
		 Main p = new Main();
		 p.run();
	}

	public void run() {
		N = reader.nextInt();
		String s = reader.next();
		if(s.length()<=N)
			System.out.print(s);
		else
			System.out.print(s.substring(0,k+1)+"...");
	}
}


Compiler output:
Main.java:17: error: cannot find symbol
			System.out.print(s.substring(0,k+1)+"...");
			                               ^
  symbol:   variable k
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main{
	int N;
	Scanner reader = new Scanner(System.in);
	public static void main(String[]args) {
		 Main p = new Main();
		 p.run();
	}

	public void run() {
		N = reader.nextInt();
		String s = reader.next();
		if(s.length()<=K)
			System.out.print(s);
		else
			System.out.print(s.substring(0,k+1)+"...");
	}
}


Compiler output:
Main.java:14: error: cannot find symbol
		if(s.length()<=K)
		               ^
  symbol:   variable K
  location: class Main
Main.java:17: error: cannot find symbol
			System.out.print(s.substring(0,k+1)+"...");
			                               ^
  symbol:   variable k
  location: class Main
2 errors
Language: C

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

int main(){
  int x;
  string str;
  cin >> x >> str;
  cout << str.substr(0, x);
  if(x < str.length()){
  	cout << "...";
  }
  return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: redeclaration of 'int n'
   10 |   int n=s.size();
      |       ^
a.cc:6:8: note: 'int n' previously declared here
    6 |  int k,n,i;
      |        ^
Language: C++

#include<iostream>
using namespace std;
int main(){
	int n;
    string s;
    if(s.size()<=n){
    	cout << s << endl;
    }
    else{
    	for(i=0;i<n;i++)
    		cout << s[i];
        cout << "...\n" << endl;
    }
	return 0;
}

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

#include<iostream>
#include<iomanip>
#include<cstdlib>
#include<cmath>
using namespace std;

int main(){
    int  k;
    cin >> k;
    char s[101];
    cin >> s;

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




Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: 'strlen' was not declared in this scope
   13 |     if(strlen(s)<=k){
      |        ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<cmath>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define db double
using namespace std;
int n;
string s;
int main()
{
    cin>>n>>s;
    for(int i=0;i<min(k,s.size());i++)
        cout<<s[i];
    if(k<s.size()) cout<<"...";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: 'k' was not declared in this scope
   10 |     for(int i=0;i<min(k,s.size());i++)
      |                       ^
a.cc:12:8: error: 'k' was not declared in this scope
   12 |     if(k<s.size()) cout<<"...";
      |        ^
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int K = sc.nextInt();
    String S = sc.next();
    String[] ary = S.split("");
    sc.close();
    String res = "";
    if (S.length >= K) {
      System.out.println(S);
    } else{
      for (int i = 0; i < K -1; i++){
        res = res + ary[i];
      }
      System.out.println(res);
    }
  }
}


Compiler output:
Main.java:11: error: cannot find symbol
    if (S.length >= K) {
         ^
  symbol:   variable length
  location: variable S of type String
1 error
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner();
    int K = sc.nextInt();
    String S = sc.next();
    String[] ary = S.split("");
    sc.close();
    String res = "";
    if (S.length >= K) {
      System.out.println(S);
    } else{
      for (int i = 0; i < K -1; i++){
        res = res + ary[i];
      }
      System.out.println(res);
    }
  }
}


Compiler output:
Main.java:5: error: no suitable constructor found for Scanner(no arguments)
    Scanner sc = new Scanner();
                 ^
    constructor Scanner.Scanner(Readable,Pattern) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Readable) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,CharsetDecoder) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,Charset) is not applicable
      (actual and formal argument lists differ in length)
Main.java:11: error: cannot find symbol
    if (S.length >= K) {
         ^
  symbol:   variable length
  location: variable S of type String
2 errors
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String[] s){
    Scanner sc = new Scanner;
    int K = sc.nextInt();
    String S = sc.next();
    String[] ary = S.split("");
    sc.close();
    String res = "";
    if (S.length >= K) {
      System.out.println(S);
    } else{
      for (int i = 0; i < K -1; i++){
        res = res + ary[i];
      }
      System.out.println(res);
    }
  }
}

Compiler output:
Main.java:5: error: '(' or '[' expected
    Scanner sc = new Scanner;
                            ^
1 error
Language: Java

import java.util.Scanner;
public class guess{
  public static void main(String args[]){
      Scanner l = new Scanner(System.in);
      System.out.println("Enter length: ");
      int length = l.nextInt();
      
      Scanner s = new Scanner(System.in);
      System.out.print("Enter String: ");
      String word = s.nextLine();
      String newS = "";
      
      if(word.length() <= length){
          System.out.println(word);
        }
        else{
            newS = word.substring(0, length);
            System.out.println(newS+"...");
        }
}
}


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

///HELLO THERE~!
///CREATED BY MD SADMAN MEHEDI SIVAN(IUT CSE-SWE^19)

#include <bits/stdc++.h>

#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define read freopen("blue.txt","r",stdin);
#define write freopen("red.txt","w",stdout);
#define pie 2*acos(0.0);

typedef long long ll;

using namespace std;

int  main()
{

    fastio;

    int n;
    cin>>n;

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

    return 0;
}


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

import java.util.Scanner;
public class guess{
  public static void main(String args[]){
      Scanner l = new Scanner(System.in);
      System.out.println("Enter length: ");
      int length = l.nextInt();
      
      Scanner s = new Scanner(System.in);
      System.out.print("Enter String: ");
      String word = s.nextLine();
      String newS = "";
      
      if(word.length()-1 <= length){
          System.out.println(word);
        }
        else{
            newS = word.substring(0, length);
            System.out.println(newS+"...");
        }
}
}


Compiler output:
Main.java:2: error: class guess is public, should be declared in a file named guess.java
public class guess{
       ^
1 error
Language: Java

#include<stdio.h>
int main()
{
  char c[1000]="",k;
  scanf("%d\n",&k);
  scanf("%s\n",c);
  int i,s=0;
  for(i=0;c[i]!='\0';i++)
  {
      s++;
  }
  
      if(k<s){
          for(i=0;i<k;i++)
          {
              printf("%c",c[i]);
          }
          printf("...");
      }
      else
      {
          
          for(i=0;i<k;i++)
          {
              printf("%c",c[i]);
          }
      }
    
  }
 
 

Compiler output:
Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
        ^
Main.java:5: error: class, interface, enum, or record expected
  scanf("%d\n",&k);
  ^
Main.java:6: error: class, interface, enum, or record expected
  scanf("%s\n",c);
  ^
Main.java:7: error: class, interface, enum, or record expected
  int i,s=0;
  ^
Main.java:8: error: class, interface, enum, or record expected
  for(i=0;c[i]!='\0';i++)
  ^
Main.java:8: error: class, interface, enum, or record expected
  for(i=0;c[i]!='\0';i++)
          ^
Main.java:8: error: class, interface, enum, or record expected
  for(i=0;c[i]!='\0';i++)
                     ^
Main.java:11: error: class, interface, enum, or record expected
  }
  ^
Main.java:14: error: class, interface, enum, or record expected
          for(i=0;i<k;i++)
                  ^
Main.java:14: error: class, interface, enum, or record expected
          for(i=0;i<k;i++)
                      ^
Main.java:17: error: class, interface, enum, or record expected
          }
          ^
Main.java:19: error: class, interface, enum, or record expected
      }
      ^
Main.java:23: error: class, interface, enum, or record expected
          for(i=0;i<k;i++)
                  ^
Main.java:23: error: class, interface, enum, or record expected
          for(i=0;i<k;i++)
                      ^
Main.java:26: error: class, interface, enum, or record expected
          }
          ^
16 errors
Language: C++

#define lint __int128
#define vi vector<int>
#define pb push_back
#define lp(i,a,b) for(int i = a ; i <= b ; i ++)
#define rlp(i,a,b) for(int i = b ; i >= a ; i --)
#define a_sort(v) sort(v.begin(), v.end())
#define d_sort(v) sort(v.rbegin(), v.rend())
#define pii pair<int,int>
using namespace std ;
// #define debug
 
const int MOD = 1E9 + 7 ;
const int N = 1E5 ;
 
int main() {
    #ifdef debug
    freopen("input.txt", "r", stdin) ;
    freopen("output.txt", "w", stdout) ;
    #endif // debug
    optimize
 
    int k ; cin >> k ;
    string s ; cin >> s ;
    int l = s.size() ;
    if(l > k) cout << s.substr(0, k) << "...\n" ;
    else cout << s << endl ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'optimize' was not declared in this scope
   20 |     optimize
      |     ^~~~~~~~
a.cc:22:13: error: 'cin' was not declared in this scope
   22 |     int k ; cin >> k ;
      |             ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #define lint __int128
a.cc:22:20: error: 'k' was not declared in this scope
   22 |     int k ; cin >> k ;
      |                    ^
a.cc:23:5: error: 'string' was not declared in this scope
   23 |     string s ; cin >> s ;
      |     ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | #define lint __int128
a.cc:23:23: error: 's' was not declared in this scope
   23 |     string s ; cin >> s ;
      |                       ^
a.cc:25:15: error: 'cout' was not declared in this scope
   25 |     if(l > k) cout << s.substr(0, k) << "...\n" ;
      |               ^~~~
a.cc:25:15: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:10: error: 'cout' was not declared in this scope
   26 |     else cout << s << endl ;
      |          ^~~~
a.cc:26:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:23: error: 'endl' was not declared in this scope
   26 |     else 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 | #define lint __int128
Language: Java

import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int K = sc.nextInt();
    StringBuilder sb = new StringBuilder(sc.next());
    if(sb.length() <= K){
      System.out.print(sb.toString());
    }else{
      System.out.print(sb.substring(0, K-1).toStirng() + "...");
    }
  }
}


Compiler output:
Main.java:10: error: cannot find symbol
      System.out.print(sb.substring(0, K-1).toStirng() + "...");
                                           ^
  symbol:   method toStirng()
  location: class String
1 error
Language: Java

import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int K = sc.nextInt();
    StringBuilder sb = new StringBuilder(sc.next());
    if(sb.length() <= K){
      System.out.print(sb.toString());
    }else{
      System.out.print(sb.subString(0, K-1).toStirng() + "...");
    }
  }
}

Compiler output:
Main.java:10: error: cannot find symbol
      System.out.print(sb.subString(0, K-1).toStirng() + "...");
                         ^
  symbol:   method subString(int,int)
  location: variable sb of type StringBuilder
1 error
Language: C++

#include <bits/stdc++.h> // Include every standard library
using namespace std;
int main()
{
  int a;
  cin>>a;
  string s;
  cin>>s;
 int len=s.size();
  if(len==a)cout<<s<<endl;
  else {
    for(int i=0;i<a;i++)
    {
      cout<<s[i];
    }
    for(ll i=0;i<3;i++)cout<<".";
    cout<<endl;
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'll' was not declared in this scope
   16 |     for(ll i=0;i<3;i++)cout<<".";
      |         ^~
a.cc:16:16: error: 'i' was not declared in this scope
   16 |     for(ll i=0;i<3;i++)cout<<".";
      |                ^