⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sumatorias.cpp

📁 Topics Practices: Programming and Numerical Methods Practice 1: Introduction to C Practice 2
💻 CPP
字号:
//Cacule la sumatoria de n^x

#include<stdio.h>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     #include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
      int n,i;
      float x,sum;
      printf("Ingrese el valor de n \n");
      scanf("%d", &n);
      printf("Ingrese el valor de x \n");
      scanf("%f", &x);
         sum=0;
         for(i=0; i<=n; i=i+1)
         { 
                  sum=sum + pow(x,i);
                  }
                  printf("El valor de la suma: %f \n", sum);
                 
              getch();
              }                               

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -