#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main() { int n,i; while(scanf("%d",&n)!=EOF){ int sum=1,sum2; int a[1000]={1}; for(i=1;i<n;i++){ a[i]=a[i-1]*2; sum=sum+a[i]; } sum2=n*100000; printf("%d %d\n",sum,sum2); } } |
Double click to view unformatted code.