Advertisement
joaquinflorespalao

tarea

May 19th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. // Example program
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. void notas(){
  8.  
  9. short n;
  10. cout<<"Ingrese n: ";cin >> n ;cout<< endl;
  11. float* Notas= new float [n];
  12.  
  13. for(short a=0; a<n;a++){
  14. cin >> Notas[ a ];
  15. }
  16. *(Notas+1)=-7;
  17.  
  18. for(short a=0; a<n;a++){
  19. cout << "La nota es: "<< Notas[ a ]<< endl;
  20. }
  21.  
  22. delete[] Notas;
  23. }
  24.  
  25. void MaximoValor(){
  26.  
  27. short n;
  28. cout<<"Ingrese n: ";cin >> n ;cout<< endl;
  29. float* Notas= new float [n];
  30.  
  31. for(short a=0; a<n;a++){
  32. cin >> Notas[ a ];
  33. }
  34. delete[] Notas;
  35. }
  36.  
  37. void Promedio(){
  38. short n;
  39. float Promedio=0;
  40. cout<<"Ingrese n: ";cin >> n ;cout<< endl;
  41. float* Notas= new float [n];
  42.  
  43.  
  44. for(short a=0; a<n;a++){
  45. cin >> Notas[ a ];
  46. Promedio += Notas[a]/n;
  47. }cout << "El promredio es: " << Promedio;
  48. delete[] Notas;
  49. }
  50.  
  51. void Indice_segun_nota(){
  52.  
  53.  
  54.  
  55. delete[] Notas;
  56. }
  57.  
  58. void Notas_ascendentes(){
  59.  
  60.  
  61. delete[] Notas;
  62. }
  63.  
  64. int main()
  65. {
  66. // notas();
  67. MaximoValor();
  68. // Promedio();
  69. Indice_segun_nota();
  70. Notas_ascendentes();
  71.  
  72. return 0;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement