Skip to content

Instantly share code, notes, and snippets.

@Rockbet
Created September 7, 2021 22:11
Show Gist options
  • Save Rockbet/7ec998bde9a5c89b246eadf48759e2a3 to your computer and use it in GitHub Desktop.
Save Rockbet/7ec998bde9a5c89b246eadf48759e2a3 to your computer and use it in GitHub Desktop.
#include<bits/stdc++.h>
using namespace std;
int freq[26];
int main(){
ios_base::sync_with_stdio(false); cin.tie(NULL);
int n;
cin >> n;
int soma = 0;
for(int i=1; i<=n; i++){
int num;
cin >> num;
int p = num%10;
num /= 10;
int valor = 1;
for(int j=1; j<=p; j++){
valor *= num;
}
soma += valor;
}
cout << soma << "\n";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment