Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int n,i,j,a,b,c,d;
- scanf("%d",&n);
- if(n<=100){
- for(i=1;i<=n;i++){
- scanf("%d",&a);
- if(a<=50){
- for(j=a;j>=0;j--){
- if(j>=2){
- printf("2^%d + ",j);
- }
- else if(j==1){
- printf("%d + ",2*j);
- }
- else if(j==0){
- printf("%d",j+1);
- }
- }
- }
- printf("\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement