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

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

const int MOD = 1000000007;

//long long
using ll = long long;

//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
 
// begin() end()
#define all(x) (x).begin(),(x).end()

//for
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

//最大公約数 
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}





int main(){
string s; cin >>s;
int K; cin >> K;
int N = s.size();
REP(i, N){
    int d = 'z' - s.at(i) + 1;
    if(s.at(i) != 'a' && d <= K){
        s.at(i) = 'a';
        K -= d;
    }
}
K %= 26;
s.at(N - 1) += k;
print(s); 

}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:16: error: 'k' was not declared in this scope
   49 | s.at(N - 1) += k;
      |                ^
Language: C++

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

const int MOD = 1000000007;

//long long
using ll = long long;

//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
 
// begin() end()
#define all(x) (x).begin(),(x).end()

//for
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

//最大公約数 
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}





int main(){
string s; cin >>s;
int K; cin >> K;
int N = s.size();
REP(i, N){
    int d = 'z' - s.at(i) + 1;
    if(s.at(i) != 'a' && d <= K){
        s.at(i) = 'a';
        K -= d;
    }
}
k %= 26;
s.at(i) += k;
print(s); 

}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:1: error: 'k' was not declared in this scope
   48 | k %= 26;
      | ^
a.cc:49:6: error: 'i' was not declared in this scope
   49 | s.at(i) += k;
      |      ^
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define int long long
#define double long double
#define low lower_bound
#define upp upper_bound
#define rep(i,n) for (int i = 0; i < (int)(n); ++i)
#define Rep(i,n) for (int i = (int)(n); i >= 0; --i)
#define all(vec) vec.begin(), vec.end()
#define rever(vec) reverse(all(vec));
#define cend printf("\n");
#define prique(T) priority_queue<T, vector<T>, greater<T>>
#define prique2(T) priority_queue<T>

struct edge { int to, cost; };
using P = pair<int, int>;
using PP = pair<P, int>;
using D = pair<double, double>;
//const long long mod = 998244353;
const long long mod = 1e9 + 7, inf = 1e16;
const string sp = " ";
template<class T> inline bool chmax(T& a, T b) {
	if (a < b) {
		a = max(a, b);
		return true;
	}
	return false;
}
template<class T> inline bool chmin(T& a, T b) {
	if (a > b) {
		a = min(a, b);
		return true;
	}
	return false;
}

int modpow(int x, int n) {
	int ans = 1;
	while (n > 0) {
		if (n & 1) {
			ans *= x;
			if (mod <= ans) ans %= mod;
		}
		x *= x;
		if (mod <= x) x %= mod;
		n >>= 1;
	}
	return ans;
}

int fact[1000000];
void f_init(int n) {
	if (1000000 <= n) return;
	fact[0] = fact[1] = 1;
	for (int i = 2; i <= n; ++i) {
		fact[i] *= fact[i - 1];
		if (mod <= fact[i]) fact[i] %= mod;
	}
	return;
}

int comb(int n, int r) {
	if (n < r) return 0;
	int ans = fact[n] * modpow(fact[n - r], mod - 2) % mod * modpow(fact[r], mod - 2);
	if (ans < 0) return ans + mod;
	return ans;
}

int perm(int n, int r) {
	if (n < r) return 0;
	if (n - r < r) r = n - r;
	int ans = fact[n] * modpow(fact[n - r], mod - 2) % mod;
	if (ans < 0) return ans + mod;
	return ans;
}

int gcd(int a, int b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

int lcm(int a, int b) {
	return a / gcd(a, b) * b;
}

bool pri(int p) {
	for (int i = 2; i * i <= p; ++i) if (p % i == 0) return false;
	return p > 1;
}

map<int, int> factring(int n) {
	map<int, int>ans;
	for (int i = 2; i * i <= n; ++i) {
		while (n % i == 0) {
			n /= i;
			++ans[i];
		}
	}
	if (n != 1) ++ans[n];
	return ans;
}

string s;
int n, k;
int main() {
	cin >> s >> k;
	n = s.size();
	rep(i, n) {
		if (26 - (s[i] - 'a') <= k) {
			k -= 26 - (s[i] - 'a');
			s[i] = 'a';
		}
	}
	k %= 26;
	rep(i, k) {
		if (s[n - 1] == 'z') s[n - 1] = 'a';
		else s[n - 1] = (char)(s[n - 1] + 1);
	}
	cout << s << endl;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 50;

template<typename T>void chmax(T &a,T b){a=max(a,b);}
template<typename T>void chmin(T &a,T b){a=min(a,b);}
using namespace std;

void solve(){
	string s;
	cin>>s;
	int k;
	cin>>k;
	rep(i,s.size()){
		int sum;
		sum=26-(int)(s[i]-'a');
		if(k-sum>=0){
			s[i]='a';
			k-=sum;
		}
	}
	if(k>0){
		k%=26;
		if((int)(s.back()-'a'+k>26))
	}
	cout<<s<<endl;
}

signed main(){
	std::ios::sync_with_stdio(false);
    std::cin.tie(0);
	solve();
	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:43:9: error: expected primary-expression before '}' token
   43 |         }
      |         ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(){
  string s;
  int n;cin>>s>>n;
  vector<int> a;
  for(int i = 0; s.size() > i; i++){
    a.push_back(s[i]-'a');
  }
  for(int i = 0; s.size()-1 > i; i++){
    if(!(n-a[i] < 0))a[o]=0,n-=a[i];
    cout << (char)('a'+a[i]);
  }
  cout << (char)('a'+(n%26)) << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: 'o' was not declared in this scope
   12 |     if(!(n-a[i] < 0))a[o]=0,n-=a[i];
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	string s;
	ll k;
	cin>>s>>k;
	for(int i=0;i<s.size();i++){
		ll now=26-(s[i]-'a');
		if(k>=now){
			s[i]='a';
			k-=now;
		}
	}
	if(k>0){
		k%=26;
		s[s.size()-1]=s[s.size()-1]+k;
	}
	cout << s;
	// your code goes here
	retu

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'retu' was not declared in this scope
   24 |         retu
      |         ^~~~
a.cc:24:13: error: expected '}' at end of input
   24 |         retu
      |             ^
a.cc:7:12: note: to match this '{'
    7 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
#define itn int
#define rep(i, n) for(int i = 0; i < n; i++)
#define irep(i,n) for(int i = n-1; i>=0; i--)
#define FOR(a,b) for(int i=a; i<b+1; i++)
using namespace std;
typedef long long ll;


int main() {
    string s;
    cin >> s;
    ll k;
    cin >> k;
    REP(i,s.size()){
        int tmp='z'-s[i]+1;
        if(k>=tmp){
            k-=tmp;
            s[i]='a';
        }
    }
    cout << s << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'i' was not declared in this scope
   15 |     REP(i,s.size()){
      |         ^
a.cc:15:5: error: 'REP' was not declared in this scope
   15 |     REP(i,s.size()){
      |     ^~~
Language: C++

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

int main() {
  string s;
  int K;
  cin >> s >> K;
  for(int i=0;i<s.length();i++){
    else if(K>='a'-s[i]){
      K-='a'-s[i];
      s[i]='a';
    }
  }
  K=K%26;
  s[s.length()-1]=s[s.length()-1]+K;
  cout << s;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'else' without a previous 'if'
    9 |     else if(K>='a'-s[i]){
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())//vectorの降順ソート
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }


int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int N,K,Q,A[2020];

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin>>s;
    int k;
    cin>>k;
    int n=s.size();

    for(int i=0;i<n-1;i++){
        if('z'-s[i]+1<=k){
            k-=('z'-s[i]+1);
            s[i]='a';
        }
        else continue;
    }
    k %= 26;
    for(int j=0;j<k;j++){
        s[i]++;
        if(s[i]>'z') s[i]='a';
    }

    cout<<s<<endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:11: error: 'i' was not declared in this scope
   46 |         s[i]++;
      |           ^
Language: Java

import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		StringBuffer sb=new StringBuffer();
		for(int i = 0; i<s.length(); i++){
			if((26-(s.charAt(i)-'a'))<=k){
				k-=26-(s.charAt(i)-'a');
				sb.append('a');
			}else{
				sb.append(s.charAt(i));
			}
		}
		if(k>0){
			char t=sb.charAt(s.length()-1);
			sb.delete(s.length()-1,s.length());
			sb.append((char)((t+k)%26)));
		}
		System.out.println(sb);
	}
}


Compiler output:
Main.java:19: error: ';' expected
			sb.append((char)((t+k)%26)));
			                           ^
1 error
Language: C++

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

signed main() {
    string s;
    int K;
    cin >> s >> K;

    string ans = s;
    int cnt = 0;
    for (int i = 0; i < s.size(); i++) {
        int t = 'z' - s[i] + 1;
        if (cnt + t <= K) {
            ans[i] = 'a';
            cnt += t;
        }
    }
    char& c = ans.back();
    c = 'a' + (c - 'a' + max(0, K - cnt)) % 26;
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:29: error: no matching function for call to 'max(int, long long int)'
   20 |     c = 'a' + (c - 'a' + max(0, K - cnt)) % 26;
      |                          ~~~^~~~~~~~~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:20:29: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   20 |     c = 'a' + (c - 'a' + max(0, K - cnt)) % 26;
      |                          ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303: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:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:20:29: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   20 |     c = 'a' + (c - 'a' + max(0, K - cnt)) % 26;
      |                          ~~~^~~~~~~~~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
  string s;
  long long x;
  cin >> s;
  cin >> x;
  for(i=0;i<s.size()-1;i++){
    if('z'-s[i]+1<=x){
      x-='z'-s[i]+1;
      s[i]='a';
    }
    cout << s[i];
  }
  long long t = s[n-1]-'a';
  t=(t+x)%26;
  cout << 'a'+t << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   for(i=0;i<s.size()-1;i++){
      |       ^
a.cc:18:19: error: 'n' was not declared in this scope
   18 |   long long t = s[n-1]-'a';
      |                   ^
Language: C++

#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
const double EPS = 1e-10;
using namespace std;
#define COUT(v) cout<<(v)<<endl
#define COUTDOUBLE(v) cout << std::setprecision(10)<<(v)<<endl;
#define CIN(n)  int(n);cin >> (n)
#define LCIN(n) LL(n);cin >> (n)
#define SCIN(n) string(n);cin >> (n)
#define YES(n) cout<<((n)? "YES" : "NO")<<endl
#define Yes(n) cout<<((n)? "Yes" : "No")<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) <<endl

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)

#define FOREACH(x,a) for(auto& (x) : (a) )

#define ALL(obj) (obj).begin(),(obj).end()

#define P pair<LL,LL>
#define I vector<int>
#define pb(v) push_back(v)
#define V vector
#define rt return
#define rmsame(a) sort(ALL(a)),a.erase(unique(ALL(a)), a.end())
#define ENDL cout<<endl
#define f first
#define s second

typedef string::const_iterator State;
class PalseError {};
class Edge{
public:
    int from,to,value;
    Edge(LL a,LL b,LL c){
        from = a;
        to = b;
        value = c;
    }
    Edge(LL a,LL b){
        from = a;
        to = b;
    }
};
int dis(char c){
    int hoge = c-'a';
    return (27-hoge)%27;
}
int main(){
    SCIN(str);
    CIN(K);
    string ans;
    for(char c :str){
        int calc = dis(c);
        if(calc <= K){
            ans.push_back('a');
        }else{
            ans.push_back();
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:64:26: error: no matching function for call to 'std::__cxx11::basic_string<char>::push_back()'
   64 |             ans.push_back();
      |             ~~~~~~~~~~~~~^~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1572:7: note: candidate: 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::push_back(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 1572 |       push_back(_CharT __c)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:1572:7: note:   candidate expects 1 argument, 0 provided
Language: C++

codefestival
100#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define rep(i, a) for (int i = 0; (i) < (int) (a); (i)++)
#define reps(i, a, b) for (int i = (int) (a); (i) < (int) (b); (i)++)
#define rrep(i, a) for (int i = (int) a-1; (i) >= 0; (i)--)
#define rreps(i, a, b) for (int i = (int) (a)-1; (i) >= (int) (b); (i)--)
#define MP(a, b) make_pair((a), (b))
#define PB(a) push_back((a))
#define all(v) (v).begin(), (v).end()
#define PERM(v) next_permutation(all(v))
#define UNIQUE(v) sort(all(v));(v).erase(unique(all(v)), v.end())
#define CIN(type, x) type x;cin >> x
#define TRUE__  "YES"
#define FALSE__ "NO"
#define PRINT(f) if((f)){cout << (TRUE__) << endl;}else{cout << FALSE__ << endl;}
#define RS resize
#define CINV(v, N) do {\
	v.RS(N);\
	rep(i, N) cin >> v[i];\
} while (0);
#define RCINV(v, N) do {\
	v.RS(N);\
	rrep(i, N) cin >> v[i];\
} while (0);

#define MOD 1000000007

void init();
void solve();

signed main()
{
	init();
	solve();
}

string s;
int K;

void init()
{
	cin >> s >> K;
}

void update(int pos)
{
	if (s[pos] == 'a') return;
	int t = 'z' - s[pos] + 1;
	if (t <= K) {
		K-= t;
		s[pos] = 'a';
	}
}

void solve()
{
	rep(i, s.length()) update(i);
	while (K--) {
		s.back()++;
		if (s.back() > 'z') s.back() = 'a';
	}
	cout << s << endl;
}





Compiler output:
a.cc:2:4: error: stray '#' in program
    2 | 100#include <bits/stdc++.h>
      |    ^
a.cc:1:1: error: 'codefestival' does not name a type
    1 | codefestival
      | ^~~~~~~~~~~~
a.cc:41:1: error: 'string' does not name a type
   41 | string s;
      | ^~~~~~
a.cc: In function 'void init()':
a.cc:46:9: error: 'cin' was not declared in this scope
   46 |         cin >> s >> K;
      |         ^~~
a.cc:46:16: error: 's' was not declared in this scope
   46 |         cin >> s >> K;
      |                ^
a.cc: In function 'void update(int)':
a.cc:51:13: error: 's' was not declared in this scope
   51 |         if (s[pos] == 'a') return;
      |             ^
a.cc:52:23: error: 's' was not declared in this scope
   52 |         int t = 'z' - s[pos] + 1;
      |                       ^
a.cc: In function 'void solve()':
a.cc:61:16: error: 's' was not declared in this scope
   61 |         rep(i, s.length()) update(i);
      |                ^
a.cc:7:48: note: in definition of macro 'rep'
    7 | #define rep(i, a) for (int i = 0; (i) < (int) (a); (i)++)
      |                                                ^
a.cc:63:17: error: 's' was not declared in this scope
   63 |                 s.back()++;
      |                 ^
a.cc:66:9: error: 'cout' was not declared in this scope
   66 |         cout << s << endl;
      |         ^~~~
a.cc:66:17: error: 's' was not declared in this scope
   66 |         cout << s << endl;
      |                 ^
a.cc:66:22: error: 'endl' was not declared in this scope
   66 |         cout << s << endl;
      |                      ^~~~
Language: C++

#include<bots/stdc++.h>
using namespace std;
int main(){
  string s;cin>>s;
  int k;cin>>k;
  for(int i=0;i<s.size();i++){
    int a=s.at(i)-'a';
    if(26-a<=k){
      s.at(i)='a';
      k-=26-a;
    }
  }
  if(k>0){
    k%=26;
    int b=s.at(s.size()-1)-'a';
    if(k>=26-b){
      s.at(s.size()-1)='a'+k-(26-b);
    }
    else s.at(s.size()-1)+=k;
  }
  cout<<s<<endl;
}

Compiler output:
a.cc:1:9: fatal error: bots/stdc++.h: No such file or directory
    1 | #include<bots/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define int long long
#define pb push_back
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define REP(i, n) FOR(i, 0, n)

signed main () {
  string s;
  cin >> s;
  int k;
  cin >> k;
  REP(i, s.size()) {
    if (i == s.size() - 1) {
      if('z' - s[i] >= k) {
        s[i] += k;
      } else {
        k -= 'z' - s[i];
        s[i] = 'a' + (k%26) - 1;
      }
    } else if('z' - s[i] + 1 <= k && s[i] != a) {
      k -= 'z' - s[i] + 1;
      s[i] = 'a';
    }
    if (k == 0) break;
  }
  cout << s << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:46: error: 'a' was not declared in this scope
   23 |     } else if('z' - s[i] + 1 <= k && s[i] != a) {
      |                                              ^
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S; cin >> S;
    int K; cin >> K;
    rep(i, S.length()) {
        int distance = 'z' - S[i] + 1;
        if (K >= distance) {
            K -= distance;
            S[i] = 'a';
        }
    }
    K = K % 26 + 26;
    while(K--) {
        if (S[S.length()-1] == 'z') S[S.legnth()-1] = 'a';
        else S[S.length()-1] += 1;
    }
    
    cout << S << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:41: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'legnth'; did you mean 'length'?
   29 |         if (S[S.length()-1] == 'z') S[S.legnth()-1] = 'a';
      |                                         ^~~~~~
      |                                         length
Language: C

#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<stack>
#include<map>
#include<iostream>
#include<algorithm>
#define m(a,b) memset(a,b,sizeof(a));
using namespace std;
typedef long long LL;
typedef pair<int,int>PII;
const int inf = 1 << 30;
map<char,int>mp;
map<char,int>::iterator it;
const int maxn = 1e5;
bool ans = true;
int main(){
	string a;
	int k;
	cin >> a >> k;
	int l = a.size();
	for(int i = 0;i<l;i++){
		if(k==0) break;
		if(a[i]=='a') continue;
		if('z'-a[i]+1<=k){
			k-='z'-a[i]+1;
			a[i] = 'a';
		}
	}
	if(a[l-1]+k > 'z')	a[l-1] = 'a'+(k-('z'-a[l-1]+1))%26;
	else a[l-1] = a[l-1] + k;
	cout << a << endl;
	return 0;
}

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

#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<stack>
#include<map>
#include<iostream>
#include<algorithm>
#define m(a,b) memset(a,b,sizeof(a));
using namespace std;
typedef long long LL;
typedef pair<int,int>PII;
const int inf = 1 << 30;
map<char,int>mp;
map<char,int>::iterator it;
const int maxn = 1e5;
bool ans = true;
int main(){
	string a;
	int k;
	cin >> a >> k;
	for(int i = 0;i<a.size();i++){
		if(k==0) break;
		if(a[i]=='a') concontinue;
		if('z'-a[i]+1<=k){
			k-='z'-a[i]+1;
			a[i] = 'a';
		}
	}
	a[a.size()-1] = a[a.size()-1]+k;
	cout << a << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:31: error: 'concontinue' was not declared in this scope
   25 |                 if(a[i]=='a') concontinue;
      |                               ^~~~~~~~~~~
Language: C

#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<stack>
#include<map>
#include<iostream>
#include<algorithm>
#define m(a,b) memset(a,b,sizeof(a));
using namespace std;
typedef long long LL;
typedef pair<int,int>PII;
const int inf = 1 << 30;
map<char,int>mp;
map<char,int>::iterator it;
const int maxn = 1e5;
bool ans = true;
int main(){
	string a;
	int k;
	cin >> a >> k;
	for(int i = 0;i<a.size();i++){
		if(k==0) break;
		if('z'-a[i]+1<=k){
			k-='z'-a[i]+1;
			a[i] = 'a';
		}
	}
	a[a.size()-1] = a[a.size()-1]+k;
	cout << a << endl;
	return 0;
}

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

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
using namespace std;
const int maxn=1e5;
int main(){
	int k; char a[maxn+3];
    gets(a);
    cin>>k;
    int n=strlen(a);
  	for(int i=0;i<n;i++){
		if(k>=(int)'z'-a[i]+1){
			a[i]='a';
			k-=(int)'z'-a[i]+1;
			}
	}
	if(k!=0)a[n-1]+=k;
    puts(a);
}




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

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
const int MaxN = 1e5;
char a[MaxN + 5];
int k;

int main()
{
	gets(a);
	scanf("%d", &k);
	for(int i = 0; i < strlen(a); i++)
	{
		if(k == 0) break;
		if(a[i] == 'a') continue;
		else if((k - 1) >= 'z' - a[i])
		{
			k = k - 'z' + a[i] - 1;
			a[i] = 'a';
		}
		else
		{
			continue;
		}
	}
	int len = strlen(a);
	if(a[len - 1] == 'a')
	{
		a[len - 1] += k % 26;
		k = 0;
	}
	else
	{
		a[len - 1] += k;
		k = 0;
	}
    puts(a);
	return 0;
}


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

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
char str[100005],num[100005];
long long int k;
int main()
{
	int i,j,min;
	gets(str);
	scanf("%lld",&k);
	int len = strlen(str);
	for(i = 0;i < len; i++)
		num[i] = 'z' - str[i] + 1;
	for(i = 0;i < len; i++)
	{
		if(k == 0)
			break;
		if(i + 1 < len)
		{	
			if(k >= num[i])
			{
				str[i] = 'a';
				k -= num[i];
			}
		}
		else
			str[i] += k;
		if(str[i] == '{')
			str[i] = 'a';
	}
	puts(str);
	return 0;
}


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

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long LL;
const int MAXN = 1e5;

char s[MAXN + 5],ans[MAXN + 5];
LL a[MAXN + 5],b[MAXN + 5];
bool q = 0;
LL sum = 0,k = 0;

int main(){
	memset(s,0,sizeof(s));
	cin >> s+1;
	cin >> k;
	int len = strlen(s+1);
	for(int i = 1;i <= len;i++){
		a[i] = (LL)s[i];
	}
	for(int i = 1;i <= len;i++){
		if(k ==0)break;
		if(a[i] == 97)continue;
		else{
			if(a[i]+k >122){
				k =k - (122 - a[i]+1);
				a[i] = 97;	
			}
		}
	}
	if(k > 0){
		if(k > 26)k %=26;
		a[len] += k;
		if(a[len] > 122){
			a[len] = 97 + a[len] - 122;
		}
	}
	for(int i = 1;i <= len;i++){
		cout << (char)a[i];
	}
	cout << endl;
}

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

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

using namespace std;


char s[100001];
long int k = 0;
int n = 0;
int main(void) {
	
	cin >> s;
	cin >> k;


	int Len = strlen(s);

	for (int i = 0; i < Len; i++) {
		if (s[i] != 'a'&&i + 1 != Len) {
			//aにするのに必要な数
			n = ('z' - s[i]) + 1;
			if (k - n >= 0) {
				k -= n;
				s[i] = 'a';
			}
		}
	}	
	if (k != 0) {
		s[Len-1] += k;
	}
	cout << s;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:19: error: 'strlen' was not declared in this scope
   17 |         int Len = strlen(s);
      |                   ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<iostream>
  +++ |+#include <cstring>
    4 |
Language: C++

#include <cstdio>
#include<iostream>

using namespace std;


char s[100001];
long int k = 0;
int n = 0;
int main(void) {
	
	cin >> s;
	cin >> k;


	int Len = strlen(s);

	for (int i = 0; i < Len; i++) {
		if (s[i] != 'a'&&i + 1 != Len) {
			//aにするのに必要な数
			n = ('z' - s[i]) + 1;
			if (k - n >= 0) {
				k -= n;
				s[i] = 'a';
			}
		}
	}	
	if (k != 0) {
		s[Len-1] += k;
	}
	cout << s;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: 'strlen' was not declared in this scope
   16 |         int Len = strlen(s);
      |                   ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<iostream>
  +++ |+#include <cstring>
    3 |
Language: C++

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

using namespace std;

int main(void) {
	

	string s;
	int k;
	cin >> s;
	cin >> k;


	int sp = 0;
	while (k>0)
	{
		//spが範囲外にならないように
		if (s[sp] == 'a'&&sp + 1<s.length) {
			sp++;
			continue;
		}

		//aにするのに必要な数
		int n = ('z' - s[sp])+1;
		if (k - n >= 0){
			k -= n;
			s[sp] = 'a';
		}
		else if(sp + 1<s.length){
			sp++;
			continue;
		}
		else {
			k -= n;
			s[sp] += n;
		}

	}
	cout << s;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:44: 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 '()' ?)
   20 |                 if (s[sp] == 'a'&&sp + 1<s.length) {
      |                                          ~~^~~~~~
      |                                                  ()
a.cc:31:34: 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 '()' ?)
   31 |                 else if(sp + 1<s.length){
      |                                ~~^~~~~~
      |                                        ()
Language: C++

#include<bits/stdc++.h>
using namespace std;  
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define rep(i,n) for(ll i=0;i<(n);i++)  
#define pii pair<int,int>
#define piii pair<int,pii>
#define mp make_pair
#define pb push_back  
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second  
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-5;
const double PI = M_PI;  
#define DEB cerr<<"!"<<endl
#define SHOW(a,b) cerr<<(a)<<" "<<(b)<<endl
#define SHOWARRAY(ar,i,j) REP(a,i)REP(b,j)cerr<<ar[a][b]<<((b==j-1)?((a==i-1)?("\n\n"):("\n")):(" "))
  
#define DIV 1000000007
typedef vector<ll> Array;
typedef vector<Array> matrix;
typedef tuple<int,int,int> tiii;
#define mt make_tuple

vector<set<int>> vs(100001);
int main(){
  string s; cin >> s;
  int k; cin >> k;
  
  rep(i,s.size()){
    if(s[i] != 'a' && 'z' - s[i] + 1 <= k)  k -= 'z' - s[i] + 1,as[i] = 'a';
  }
  if(k > 0)
    s[s.size() - 1] = s[s.size()-1] + k/26+k%26;
  if(s[s.size()] > 'z') s[s.size()] -= 'z' + 'a';
  cout << s << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:65: error: 'as' was not declared in this scope; did you mean 's'?
   34 |     if(s[i] != 'a' && 'z' - s[i] + 1 <= k)  k -= 'z' - s[i] + 1,as[i] = 'a';
      |                                                                 ^~
      |                                                                 s
Language: C++

#include<bits/stdc++.h>
#define MP make_pair
#define PB push_back
#define PP pop_back()
#define set(x,y) memset(x,y,sizeof(x))
#define MIN3(x,y,z) min(min(x,y),z)
#define MAX3(x,y,z) max(max(x,y),z)
#define ALL(x) x.begin(),x.end()
#define sz(x) (int) x.size()
#define sag node*2+1
#define sol node*2
#define FOR(i,j,k) for(int i=j;i<=k;i++)
#define ROF(i,j,k) for(int i=j;i>=k;i--)
#define dbgs(x) cerr<<(#x)<<" --> "<<(x)<<" "
#define dbg(x) cerr<<(#x)<<" --> "<<(x)<<endl;getchar()
#define ii pair<int,int>
#define pll pair<ll,ll>
#define st first
#define nd second
#define ll long long
#define llu long long unsigned
#define lf double
#define orta (bas+son)/2
#define MOD 1000000007
#define inf 200000000000001
#define N 100005
using namespace std;

char s[N];
int n,m;

int main() {

  scanf("%s %d",s+1,&m);
  n=strlen(s+1);
  FOR(i,1,n) {
    int mov='z'-s[i]+1;
    if(mov<=m) {
      s[i]='a';
      m-=mov;
    }
  }
  m%=26;
  if(m) {
    s[n]='a'+(s[n]+m-'a'a)%26;
  }
  printf("%s",s+1);

}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:22: error: unable to find character literal operator 'operator""a' with 'char' argument
   45 |     s[n]='a'+(s[n]+m-'a'a)%26;
      |                      ^~~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef __int64 LL;
typedef vector<int> ivec;
typedef vector<string> svec;

int n;
string s;
int main(){
    cin>>s>>n;
    int m=s.size();	
    for(int i=0;i<m;i++){
    	if('z'-s[i]<n)n-=('z'-s[i])+1,s[i]='a';
	if(i==m-1)s[i]+=n;
	
    }
    cout<<s<<endl;
    return 0;
}

Compiler output:
a.cc:13:9: error: '__int64' does not name a type; did you mean '__int64_t'?
   13 | typedef __int64 LL;
      |         ^~~~~~~
      |         __int64_t
Language: C++

#include <iostream>
#include <string>

using namespace std;
 
int main(void) {
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	string s;
	cin >> s;
	int siz = s.size();

	int K;
	cin >> K;	

	string ret = "";
	for(int i = 0;i < siz - 1;i++){
		if(s[i] == "a") continue;
		
		int c = s[i];
		if(K >= 123 - c){
			K -= 123 - c;
			ret += "a";
		}else{
			ret += s[i];
		}
	}

	K %= 26;
	int c = s[siz - 1];
	if(c + K >= 123){
		ret += (c + K - 123 + 97);
	}else{
		ret += (c + K);
	}

	cout << ret << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |                 if(s[i] == "a") continue;
Language: C++

#include<iostream>
using namespace std;
int toa(char c){
 if(c=='a') return 0;
 return ('z'-c+1);
}
int main(void){
int k;
string s,res="";
cin >> s;
cin >> k;
for(int i=0;i<s.length()-1;i++){
if(toa(s[i])>k){
res+="a";
k-=toa(s[i]);
}else{
res+=s[i];
}
}
k%=26;
if(k>'z'-s[i]) k-=26;
res+=s[i]+k;
cout << res;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:12: error: 'i' was not declared in this scope
   21 | if(k>'z'-s[i]) k-=26;
      |            ^
a.cc:22:8: error: 'i' was not declared in this scope
   22 | res+=s[i]+k;
      |        ^
Language: C++

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

void solve(string& str, int k)
{
   int gap;
   int n = str.size();
   for(int i=0; i<n; i++)
   {
      gap = 'z' - str[i] + 1;
      if (i!=n-1)
      {
      	if (k>gap)
      	{
      	  str[i] = 'a';
      	  k= k-gap;
      	  continue;
      	}else{
      		continue;
      	}
      }else{
      	str[i]+= k;
      	if (str[i] > 'z')
      	{
      	   str[i] -= 26;
      	}
      }
      
   }
}
int main()
{
string str;
cin >> str;
cin >> k;
solve(str,k);
cout << str;
return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:8: error: 'k' was not declared in this scope
   35 | cin >> k;
      |        ^
Language: Java

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String  s = sc.nextLine();
		int count = sc.nextInt();
		char[] ca = s.toCharArray();
		char[] ca_n = new char[ca.length];
		for (int i=0;i<ca_n.length;i++){
			ca_n[i] = (char) (ca[i] - 96);
		}
		if (ca_n.length==1){
			ca_n[0] = (char) ((ca_n[0]+count)%26);
			if (ca_n[0]==0){
				ca_n[0] = 26;
			}
		}
		else{
			for (int i=0;i<ca_n.length;i++){
		
			
				if (ca_n[i]==1){
					continue;
				}
				else if(i==(ca_n.length-1) && count>0) {
					ca_n[i] = (char) ((ca_n[i]+count)%26);
					if (ca_n[i]==0){
						ca_n[i] = 26;
					}
				}
				else{
					if (count>0 && 27-ca_n[i] <= count){
						count -=(27-ca_n[i]);
						ca_n[i] = 1;
					}
				
				}
			}
		}
		for (int i=0;i<ca_n.length;i++){
			ca_n[i] +=96;
		}
		String s1 = new String(ca_n);
		System.out.print(s1);
	}
}

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

using namespace std;

int main(){
    char *str = new char[10000];
    int count;
    scanf("%s", str);
    scanf("%d", &count);
    
    size_t str_len = strlen(str);
    int idx = 0;
    while(count > 0){
        
        
        int sub_a = static_cast<int>(str[idx] - 97);
        int next2a = static_cast<int>(123 - str[idx]);
      
        
        if(sub_a % 26 != 0 && next2a < count){
            str[idx] = 'a';
            count -= next2a;
            idx ++;
            
        }
        else if(idx == str_len - 1){
            str[idx] = 97 + (sub_a + count) % 26;
            count = 0;
        }
        else
            idx++;
    
    }

    printf("%s", str);
    delete[] str;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'scanf' was not declared in this scope
    6 |     scanf("%s", str);
      |     ^~~~~
a.cc:9:5: error: 'size_t' was not declared in this scope
    9 |     size_t str_len = strlen(str);
      |     ^~~~~~
a.cc:1:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
  +++ |+#include <cstddef>
    1 | using namespace std;
a.cc:24:24: error: 'str_len' was not declared in this scope
   24 |         else if(idx == str_len - 1){
      |                        ^~~~~~~
a.cc:33:5: error: 'printf' was not declared in this scope
   33 |     printf("%s", str);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | using namespace std;
Language: C

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

int main() {
	char s[100001];
	int len;
	int loop;
	int k;

	scanf("%s", s);
	scanf("%d", &k);
	len = strlen(s);

	for (loop = 0; loop < len; loop++) {
		if (loop == len - 1) {
			s[loop] += k;
			do {
				s[loop] -= 26;
			} while (s[loop] > 'z')
		}
		else if ('z' - s[loop] < k) {
			k -= 'z' - s[loop] + 1;
			s[loop] = 'a';
		}
	}

	printf("%s\n", s);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:48: error: expected ';' before '}' token
   19 |                         } while (s[loop] > 'z')
      |                                                ^
      |                                                ;
   20 |                 }
      |                 ~                               
main.c:21:17: error: expected '}' before 'else'
   21 |                 else if ('z' - s[loop] < k) {
      |                 ^~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

constexpr int32_t posalpha(char ch)
{
	return ch - 'a';
}

constexpr char rotate_alpha(char ch, int32_t n)
{
	return posalpha(ch) + n < 26 ? ch + n : 'a' + (n < 26 ? n : n % 26);
}

int main(void)
{
	int32_t k, temp;
	string str;

	cin >> str;
	cin >> k;

	for (auto i{ 0 }; i < str.size(); ++i) {
		temp = 26 - posalpha(str[i]);
		if (k < temp || temp == 0)
			continue;
		k -= temp;
		str[i] = 'a';
	}

	if (k > 0)
		str.back() = nth_alpha(k);

	cout << str << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:30: error: 'nth_alpha' was not declared in this scope
   33 |                 str.back() = nth_alpha(k);
      |                              ^~~~~~~~~
Language: C

//# include <stdio.h>
# include <iostream>
//# include <cstdio>
//# include <conio.h>

/*
Next Letter
Time limit : 2sec / Memory limit : 256MB
Score : 400 points
Problem Statement
Mr. Takahashi has a string s consisting of lowercase English letters.
He repeats the following operation on s exactly K times.
    Choose an arbitrary letter on s and change that letter to the next alphabet. Note that the next letter of z is a.
For example, if you perform an operation for the second letter on aaz, aaz becomes abz.
If you then perform an operation for the third letter on abz, abz becomes aba.
Mr. Takahashi wants to have the lexicographically smallest string after performing exactly K operations on s.
Find the such string.
Constraints
    1 <= |s| <= 10^5
    All letters in s are lowercase English letters.
    1 <= K <= 10^9
Input
The input is given from Standard Input in the following format:
s
K
Output
Print the lexicographically smallest string after performing exactly K operations on s.
Sample Input 1
xyz
4
Sample Output 1
aya
For example, you can perform the following operations: xyz, yyz, zyz, ayz, aya.
Sample Input 2
a
25
Sample Output 2
z
You have to perform exactly K operations.
Sample Input 3
codefestival
100
Sample Output 3
aaaafeaaivap


*/

using namespace std;

const int N = 100100;

int n, k;
char s [N];
bool ok;

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

   ok = true;
   for ( int i=0; s [i]; i++ )
   {
      if ( 'z' - s [i] < k )
         k -= 'z' - s [i] + 1,
         s [i] = 'a',
         ok = true;
      else
         ok = false;
   }

   if ( k > 0 )
   {
      s [n-1] = 'a' + ((s [n-1] - 'a') + k) % 26;
   }

   cout << s << endl;

//getch();
   return 0;
}


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

#include <iostream>
using namespace std;
int main(){
  string s;
  cin >> s;
  int K;
  cin >> K;
  
  for(unsigned int i = 0; i < s.size(); i++){
    if(s[i] == 'a') continue;
    if(K >= long long('z' - s[i] + 1)){
      K -= long long('z' - s[i] + 1);
      s[i] = 'a';
    }
  }
 
  K = K % 26;
  while(K > 0){
    s[s.size() - 1]++;
    if(s[s.size() - 1] >'z') s[s.size() - 1] ='a';
    K--;
  }
  cout << s;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: expected primary-expression before 'long'
   11 |     if(K >= long long('z' - s[i] + 1)){
      |             ^~~~
a.cc:11:12: error: expected ')' before 'long'
   11 |     if(K >= long long('z' - s[i] + 1)){
      |       ~    ^~~~~
      |            )
a.cc:12:12: error: expected primary-expression before 'long'
   12 |       K -= long long('z' - s[i] + 1);
      |            ^~~~
Language: C++

#include <stdio.h>
#include <string.h>
void solve(int k, char*c);
int main(){
        int k;	
        char s[100001];
	fgets(s, sizeof(s), stdin);
	scanf_s("%d", &k);
	solve(k, s);
	return 0;
}
void solve(int k, char*c) {
	for (int i = 0; i < strlen(c); ++i) {
		if (c[i] != 'a' && k > 'z' - c[i]) {
			k -= 'z' - c[i] + 1;
			c[i] = 'a';
		}
	}
	if (k > 0) {
		int t = c[strlen(c) - 1] - 'a';
		t = (t + k) % 26;
		c[strlen(c) - 1] = (char)(t + 'a');
	}
	printf("%s", c);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |         scanf_s("%d", &k);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <stdio.h>
#include <string.h>
void solve(int k, char*c);
int main(){
	char s[100001];
	gets_s(s);
	int K;
	scanf_s("%d", &K);
	solve(K, s);
	return 0;
}
void solve(int k, char*c) {
	for (int i = 0; i < strlen(c); ++i) {
		if (c[i] != 'a' && k > 'z' - c[i]) {
			k -= 'z' - c[i] + 1;
			c[i] = 'a';
		}
	}
	if (k > 0) {
		int t = c[strlen(c) - 1] - 'a';
		t = (t + k) % 26;
		c[strlen(c) - 1] = (char)(t + 'a');
	}
	printf("%s", c);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'gets_s' was not declared in this scope
    6 |         gets_s(s);
      |         ^~~~~~
a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |         scanf_s("%d", &K);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <stdio.h>
#include <string.h>
void solve(int k, char*c);
int main(){
        int k;	
        char s[100001];
	fgets(s, sizeof(s), stdin);
	scanf("%d", &k);
	solve(K, s);
	return 0;
}
void solve(int k, char*c) {
	for (int i = 0; i < strlen(c); ++i) {
		if (c[i] != 'a' && k > 'z' - c[i]) {
			k -= 'z' - c[i] + 1;
			c[i] = 'a';
		}
	}
	if (k > 0) {
		int t = c[strlen(c) - 1] - 'a';
		t = (t + k) % 26;
		c[strlen(c) - 1] = (char)(t + 'a');
	}
	printf("%s", c);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: 'K' was not declared in this scope
    9 |         solve(K, s);
      |               ^
Language: C++

#include <stdio.h>
#include <string.h>
void solve(int k, char*c);
int main(){
        int K;	
        char s[100001];
	fgets(s, sizeof(s), stdin);
	scanf("%d", &k);
	solve(K, s);
	return 0;
}
void solve(int k, char*c) {
	for (int i = 0; i < strlen(c); ++i) {
		if (c[i] != 'a' && k > 'z' - c[i]) {
			k -= 'z' - c[i] + 1;
			c[i] = 'a';
		}
	}
	if (k > 0) {
		int t = c[strlen(c) - 1] - 'a';
		t = (t + k) % 26;
		c[strlen(c) - 1] = (char)(t + 'a');
	}
	printf("%s", c);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: 'k' was not declared in this scope
    8 |         scanf("%d", &k);
      |                      ^
Language: C++

#include <stdio.h>
#include <string.h>
int main(){
	char s[100001];
	gets(s);
	int K;
	scanf("%d", &K);
	int sLength = strlen(s);
	//printf("K = %d\r\n", K);
	for (int i = 0; i < sLength-1; i++){
		//printf("s[%d] = %c\r\n", i, s[i]);
		if (s[i] != 'a' && (int)('a' + 26 - s[i]) <= K){
			//printf("%d <= %d is true", (int)('a' + 26 - s[i]), K);
			
			//printf("lost %d operator\r\n", 'a' + 26 - s[i]);
			
			//printf("K = %d - %d = %d\r\n", K, (int)('a' + 26 - s[i]), K - (int)('a' + 26 - s[i]));
			K = K - (int)('a' + 26 - s[i]);
			s[i] = 'a';
		}
		else{
			continue;
		}
	}
	//printf("actually %d operator left\r\n", K);
	if (s[sLength - 1] + K >'z') {
		s[sLength - 1] = 'a' + K - ('z' - s[sLength - 1] + 1);
		//printf("%d operator left\r\n", K - ('z' - s[sLength - 1] + 1));
	}
	else s[sLength - 1] += K;
	printf("%s", s);
	return 0;
}

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


sl = list(input() )
k = int( input() )

al ="abcdefghijklmnopqrstuvwxyz"
alen = len(al)

for i in range(0,len(sl) ):
    p = alen - al.find(sl[i])
    if(p<k):
        sl[i] = 'a'
        k = k-p

#print("k,p:",k,p)

if k>0 :
    p = alen - al.find(sl[-1])  # now position
    sl[-1] = al[(k-p)%26]            # 

s = "".join(sl)
print(s)
#print(s,k,(alen-p),al[alen-p])


Compiler output:
a.cc:14:2: error: invalid preprocessing directive #print
   14 | #print("k,p:",k,p)
      |  ^~~~~
a.cc:17:33: error: stray '#' in program
   17 |     p = alen - al.find(sl[-1])  # now position
      |                                 ^
a.cc:18:38: error: stray '#' in program
   18 |     sl[-1] = al[(k-p)%26]            #
      |                                      ^
a.cc:22:2: error: invalid preprocessing directive #print
   22 | #print(s,k,(alen-p),al[alen-p])
      |  ^~~~~
a.cc:2:1: error: 'sl' does not name a type
    2 | sl = list(input() )
      | ^~
Language: C++

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

#define sz(x) (int)(x).size()


int main()
{
    //freopen("d://i.txt","r",stdin);
    //freopen("d://o.txt","w",stdout);
   string s;
   int k,i,j,sz1,x,mov;

   cin>>s>>k;

   sz1=sz(s);

   fr(i,0,sz1)
    {
        if(i==sz1-1)
        {
            if(k>('z'-s[i]))
            {
                k-='z'-s[i];
                k--;
                s[i]='a'+k;
            }
            else
                s[i]+=k;
        }
        else
        {
            mov='z'-s[i]+1;

           // cout<<mov<<endl;

            if(k<mov)
                continue;
            else
            {
                k-=mov;
                s[i]='a';
            }

        }

    }


    cout<<s<<endl;

    return 0;
}


/*
za 32
af

aaa 3
aad

*/



Compiler output:
a.cc: In function 'int main()':
a.cc:18:4: error: 'fr' was not declared in this scope
   18 |    fr(i,0,sz1)
      |    ^~