Advertisement
Mauriciocaradenepe

clase de lunes

May 28th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. #include<iostream>
  2. #include<conio.h>
  3. using namespace std;
  4. using namespace System;
  5. void multiplicacionE(int id) {
  6. int arr[12];
  7. for (int c = 0; c < 12; c++)
  8. {
  9. arr[c] = c*id;;
  10. }
  11. for (int c = 0; c < 12; c++)
  12. {
  13. cout << arr[c] << endl;
  14. }
  15. }
  16. void multiplicacionD(int id,int n) {
  17. int *arr = new int[n];
  18. for (int c = 0; c <n; c++)
  19. {
  20. arr[c]= c*id;;
  21. }
  22. for (int c = 0; c <n; c++)
  23. {
  24. cout << arr[c]<<endl;
  25. }
  26. }
  27. void pares(int id, int n) {
  28. int *arr = new int[n];
  29. for (int c = 0; c <n; c++)
  30. {
  31. arr[c] = (c+1)*id;;
  32. }
  33. for (int c = 0; c <n; c++)
  34. {
  35. cout << arr[c] << endl;
  36. }
  37. }
  38. void primos(int n) {
  39. int c = 1;
  40. for (int cd = 0; cd <n;cd++)
  41. {
  42.  
  43. }
  44. }
  45. int main() {
  46. ////declaracion de un arreglo estatico
  47. //int a[4];//arreglo de 4 espacios y empieza desde 0
  48. //cout << a[0]<<endl;
  49. //cout << a[1] << endl;
  50. //cout << a[2] << endl;
  51. //cout << a[3] << endl;
  52. //int a1[4] = { 0,1,2,3 };//arreglo de 4 espacios y empieza desde 0
  53. // //das valor a los espacios
  54. //cout << a1[0] << endl;
  55. //cout << a1[1] << endl;
  56. //cout << a1[2] << endl;
  57. //cout << a1[3] << endl;
  58. //int a2[] = { 3,2,1,0 };//arreglo de x espacios y empieza desde 0
  59. // //das los valores que quieras cuando no hay un numero
  60. // //depende de los valores que les des y define el arreglo
  61. //cout << a2[0] << endl;
  62. //cout << a2[1] << endl;
  63. //cout << a2[2] << endl;
  64. //cout << a2[3] << endl;
  65. ////declarando arreglo dinamico we :v
  66. //int *arrD = new int(10);//creo un solo valor
  67. //int *arrD1 = new int[10];//creacion de 10 espacios dinamicos
  68. //multiplicacionD(3,10);
  69. //multiplicacionE(3);
  70. //pares(2,100);
  71. primos(50);
  72. _getch();
  73. return 0;
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement