Facebook
From Harmless Agouti, 1 Year ago, written in C++.
This paste is a reply to Untitled from Chartreuse Plover - view diff
Embed
Download Paste or View Raw
Hits: 248
  1. /*
  2. edit : Le Duy Dat
  3. team : THree Wolves
  4. Task:
  5. Link:
  6. */
  7. #include <bits/stdc++.h>
  8. using namespace std;
  9. int main()
  10. {
  11.     int a;
  12.     cin >> a;
  13.     a--;
  14.     string ans;
  15.     while (a > 0)
  16.     {
  17.         int num = a % 26;
  18.         if (num == 0)
  19.             num = 26;
  20.         ans += (num + 'A');
  21.         a /= 26;
  22.     }
  23.     for (int i = ans.length() - 1; i >= 0; i--)
  24.         cout << ans[i];
  25. }

Replies to Re: Untitled rss

Title Name Language When
Re: Re: Untitled Anorexic Prairie Dog cpp 1 Year ago.