Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7211 - Тооны зэргийн хүрд

a тооны n хүртэлх зэрэгтүүдийг жишээн дээрх хэлбэрээр хэвлэ.

Input

a, n натурал тоонууд нэг мөрөнд нэг зайгаар тусгаарлагдан өгөгдөнө. (a,n<10)

Output

Зэргийн хүрдийг хэвлэ.

Example

Input:
3 5

Output:
3^1=3
3^2=9
3^3=27
3^4=81
3^5=243

Нэмсэн:Bataa
Огноо:2011-06-21
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2024-03-12 03:25:01
#include <iostream>
#include <sstream>
#include <string>
#include <cstdlib>
#include <cmath>

using namespace std;

// Headers
string toString (double);
int toInt (string);
double toDouble (string);

int main() {
int a, n, i;

cin >> a;
cin >> n;
for (i = 1; i <= n; i++) {
cout << a;
cout << "^";
cout << i;
cout << "=";
cout << pow(a, i) << endl;
}
return 0;
}

// The following implements type conversion functions.
string toString (double value) { //int also
stringstream temp;
temp << value;
return temp.str();
}

int toInt (string text) {
return atoi(text.c_str());
}

double toDouble (string text) {
return atof(text.c_str());
}
2024-03-12 03:23:29
lol


Last edit: 2024-03-12 03:24:02
2024-03-12 03:10:27
DICKRO7-1 ANI
2024-02-23 14:55:50
#include <iostream>
using namespace std;

int main() {

int a,n,c=1;
cin>>a>>n;
for(int i=1; i<=n; i++){
for(int b=0; b<i; b++){
c*=a;
}
cout<<a<<"^"<<i<<"="<<c<<endl;
c=1;
}
}
2024-02-02 04:16:23
Ariunzul cain ohin
2024-01-22 11:47:01
#include<iostream>
using namespace std;
int main() {
int n,a,u,i = 1;
cin>>n>>a;
for(u=1;u<=a;u++){
i = i * n;
cout << n <<"^" << u <<"=" <<i <<endl<<endl;

}
}
huul
2024-01-18 07:19:24
#include <stdio.h>
int a,n,i,s=1;
int main()
{
scanf("%d %d",&a,&n);
for (i=1;i<=n;i++)
printf("%d^%d=%d\n",a,i,s=s*a);
return 0;
}
2023-12-28 16:26:16
THERE'S NOTING WE CAB DO.
2023-11-24 09:24:20
#include<bits/stdc++.h>
using namespace std;
int main(){
long a, n, i, s=1;
cin>>a>>n;
for(i=1; i<=n; i++ ){
s=s*a;
cout<<a<<"^"<<i<<"="<<s<<endl;
}}
2023-03-01 17:10:05
#include <stdio.h>
int main()
{
int a,b,i,s=1;

scanf("%d %d",&a,&b);
for(i=1;i<=b;i++)
{
s=s*a;
printf("%d^%d=%d\n",a,i,s);
}
return 0;
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.