//#include "stdafx.h"//vc++6.0加上这一行.
#include "stdio.h"
void main(void){
int i,j,k,sum;
for(sum=1,i=0;i<11;i++){
for(k=1,j=0;j sum+=k;
}
printf("The result is %d.\n",sum);
}
#include
#include
using namespace std;
int main()
{
int sum=0;
int i;
for(i=0;i<=10;i++)
sum+=pow(3.0,i);
cout<system("pause");
return 0;
}
#include
#include
int main()
{
double base = 3.0, power, result = 0.0;
for(power = 0.0; power <= 10; power+=1)
{
result += (pow(base,power));
}
printf("%d\n",result);
}
int main()
{
int a = 1;
for(int i = 0 ; i<=10; i++)
{
for(int j = 0,int temp = 1; j<=i; j++)
temp *=3;
a += temp;
}
printf("the value is: %d \n",a);
return 0;
}