Advertisement
Skygen

17. darbs

Apr 18th, 2013
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.15 KB | None | 0 0
  1. #include <conio.h>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int SUMMA(int *array, int size){
  7. int count = 0;
  8. for(int i = 0;i<size;i++)
  9. count+=*array++;
  10. return count;  }
  11.  
  12. bool EKVIVALENCE(char *a, char *b)
  13. {
  14. do{if(*(a++) != *(b++))return false;
  15. }while(*a!='\0' || *b!='\0');
  16. return true;}
  17.  
  18. main()
  19. {
  20.      
  21. //int *array2 = new int[3];
  22.  
  23. char lol[] = "f";
  24. char lol2[] = "  j ";
  25. //char *lol2 = &lol;
  26.  
  27.  
  28.  
  29. cout << EKVIVALENCE(lol,lol2);
  30.      
  31. int a,b,summ = 0;
  32. float c,d;
  33.  
  34. int *po =&a, *po2 = &b;
  35. float *po3 = &c, *po4 = &d;    
  36.  
  37.  
  38. /*cout << "Ievadiet vertibu: ";
  39. cin >> *po;
  40. cout << "Ievadiet vertibu: ";
  41. cin >> *po2;
  42. cout << "Ievadiet vertibu: ";
  43. cin >> *po3;
  44. cout << "Ievadiet vertibu: ";
  45. cin >> *po4;
  46.  
  47. *po+=5;
  48.  
  49. *po4 = *po2 * *po3;
  50.  
  51. cout << *po << endl;
  52. cout << *po2 << endl;
  53. cout << *po3 << endl;
  54. cout << *po4 << endl;
  55. //======================================================
  56.  
  57. srand(time(0));
  58. int array[10];
  59.   int *pbegin = array;
  60.  
  61. for(int i = 0; i < 10;i++){
  62. *(pbegin+i) = rand()%100;
  63. count+=pbegin;}
  64.      
  65. //======================================================
  66.      
  67. */
  68.  
  69.    
  70.    
  71.       getch();
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement