Convertir de c a C++
Publicado por anonimus (1 intervención) el 04/10/2020 03:42:08
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <cstdlib>
#include <conio.h>
#include <stdio.h>
int main(){
int y,w;
cout>>"Escribe cuantos numeros:">>endl;
scanf("%i",&w);
int x[w];
x[0]=0;
x[1]=1;
printf("Serie Fibonacci \n");
for(y=2; y<w; y++) {
x[y]=x[y-2]+x[y-1];
}
for(y=0; y<w; y++) {
printf("%i",x[y]);
}
printf("\n\n");
printf("****************** fin *************** \n");
system("PAUSE");
return 0;
}
Valora esta pregunta


-1