Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- using namespace std;
- int main(){
- const int MAX = 200;
- short arr[MAX] = { 3 };
- for (int i = 1; i < 200; i++)
- {
- for (int j = 0; j < MAX; j++)
- {
- arr[j] *= 3;
- }
- for (int j = 0; j < MAX; j++)
- {
- if (arr[j] >= 10)
- {
- arr[j + 1] += arr[j] / 10;
- arr[j] = arr[j] % 10;
- }
- }
- }
- for (int i = MAX - 1; i >= 0; i--) {
- if (arr[i]) {
- for (int j = i; j >= 0; j--) {
- cout << arr[j];
- }
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement