Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ZADANIE 1
- #include <iostream>
- using namespace std;
- int a;
- int main(){
- cout << "podaj liczbe elementow tablicy: ";
- cin >> a;
- int *tab = new int[a];
- for (int i = 0; i < a; i++) cout << (intptr_t)&tab[i] << endl;
- delete []tab;
- }
- ZADANIE 2
- #include <iostream>
- using namespace std;
- int a;
- float suma;
- int main(){
- cout << "podaj liczbe ocen: ";
- cin >> a;
- int *tab = new int[a];
- for (int i = 0; i < a; i++){
- cout << "podaj ocene: " << endl;
- cin >> tab[i];
- }
- for (int i = 0; i < a; i++) suma += tab[i];
- float srednia = suma/a;
- cout << "Twoja srednia wynosi: " << srednia << endl;
- if (srednia > 1.76) cout << "przechodzisz do nastepnej klasy"<< endl;
- else cout << "nie przechodzisz do nastepnej klasy" << endl;
- delete []tab;
- }
- ZADANIE 3
- #include <iostream>
- using namespace std;
- int a;
- int main(){
- cout << "podaj ile wyrazow ciagu chcesz podac: ";
- cin >> a;
- int *tab = new int[a];
- tab[0] = 1;
- cout << tab[0] << endl;
- tab[1] = 1;
- cout << tab[1] << endl;
- for (int i = 2; i < a; i++){
- tab[i] = tab[i-1] + tab[i-2];
- cout << tab[i] << endl;
- }
- delete []tab;
- }
Advertisement
Add Comment
Please, Sign In to add comment