Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- //////////////////////////////////
- struct T
- {
- T()
- {
- nOld = -3;
- }
- string s1;
- int nOld;
- };
- void foo(T *p);
- //////////////////////////////////////////////////////
- int main()
- {
- T t1, t2, t3, t[31];
- cout << t1.nOld << endl;
- cout << t2.nOld << endl;
- cout << t3.nOld << endl;
- foo(t);
- }
- //////////////////////////////////////////////////////
- void foo(T *t)
- {
- for(int i = 1; i < 31; i++)
- {
- cout << t[i].nOld << endl;
- }
- }
- /*
- #include <iostream>
- using namespace std;
- //////////////////////////////////////////////////////
- int main()
- {
- int n = 87;
- cout << n%7 << endl;
- }
- */
- /*
- #include <iostream>
- using namespace std;
- ////////////////////////////////////////////////////////
- int book(int chislo_book)
- {
- int price = 1000;
- int summa_book = 0;
- for(int i = 1; i <= chislo_book; i++)
- {
- if(i > 1 && i <= 7) price -= 55;
- if(i > 7) price = 1000;
- summa_book += price ;
- // cout << "books:" << summa_book << endl;
- }
- return summa_book;
- }
- //////////////////////////////////////////////////////
- int main()
- {
- int n = 15;
- int n_ost = n%7;
- int n_grp = n/7;
- n_grp *= 5845;
- n_grp += book(n_ost);
- cout << "Cost of books = " << n_grp << endl;
- }
- */
- /*
- #include <iostream>
- using namespace std;
- ////////////////////////////////////////////////////////
- void book(int chislo_book)
- {
- int price = 1000;
- int summa_book = 0;
- for(int i = 1; i <= chislo_book; i++)
- {
- if(i > 1 && i <= 7) price -= 55;
- if(i > 7) price = 1000;
- summa_book += price ;
- cout << "books:" << summa_book << endl;
- }
- }
- //////////////////////////////////////////////////////
- int main()
- {
- book(7);
- }
- */
- /*
- #include <iostream>
- using namespace std;
- ////////////////////////////////////////////////////////
- void book(int chislo_book)
- {
- int price = 1000;
- int summa_book = 0;
- for(int i = 1; i < chislo_book; i++)
- {
- if(i > 1 && i <= 7) price -= 55;
- if(i > 7) price = 1000;
- summa_book += price ;
- cout << "books:" << summa_book << endl;
- }
- }
- //////////////////////////////////////////////////////
- int main()
- {
- book(10);
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement