V

@valeriiabambula34

transform (na wielkie litery)

C++
2 weeks ago
#include <iostream> #include <string> #include <algorithm> #include <cctype> using namespace std; int main() { string imieNazwisko; cout << "Podaj imie i nazwisko: "; getline(cin, imieNazwisko);

stoi()+find() (szukanie liczb w tekście)

C++
2 weeks ago
#include <iostream> #include <string> using namespace std; int main() { string dane; cout << "Podaj w formacie cena=123: "; cin>>dane; size_t pos = dane.find('='); if (pos != string::npos) {

insert()

C++
2 weeks ago
#include <iostream> #include <string> using namespace std; int main() { string tekst ="nauka"; tekst.insert(5, "C++"); //indeksy: n(0) a(1) u(2) k(3) a(4) - przed a(4)? //Uwaga: przed znakiem o indeks 5 (czyli za ostatnim znakiem "nauka") //Chcemy przedostatnie 'a'? Poprawmy dla przykładu: przed 4. //Dla jesności: przed literą 'a' (indeks 4) //Poprawka _ wstawiamy przed 4:

erase()+length()

C++
2 weeks ago
#include <iostream> #include <string> using namespace std; int main() { string slowo; cout<<"Podaj slowo: "; cin>>slowo; if(slowo.length()>3) { slowo.erase(0,3); cout<<"Po usunieciu pierwszych 3 znokow: " << slowo << endl;

replace (wersja algorytmiczna)

C++
2 weeks ago
#include <iostream> #include <string> #include<algorithm> using namespace std; int main() { string tekst; cout<<"Podaj napis: "; getline(cin, tekst); replace(tekst.begin(), tekst.end(), 'a', '@'); cout << "Po zamianie: " << tekst << endl;

find()+length()+kontenancja

C++
2 weeks ago
#include <iostream> #include <string> using namespace std; int main() { string zdanie; cout<<"Podaj zdanie: "; getline(cin, zdanie); size_t dlugosc = zdanie.length(); size_t pozycjaSpacji = zdanie.find(' ');

cw7

C++
3 weeks ago
#include <iostream> #include <string> using namespace std; int main() { string napis="Ala ma kota"; napis.replace(4,2, "nie ma"); cout<<napis; return 0;

cw6

C++
3 weeks ago
#include <iostream> #include <string> using namespace std; int main() { string napis="Ala ma kota"; napis.insert(11," Filemona"); cout<<napis; return 0;

cw5

C++
3 weeks ago
#include <iostream> #include <string> using namespace std; int main() { string napis="Ala ma kota"; napis.erase(3,3); cout<<napis; return 0;

ascll

C++
4 weeks ago
#include <iostream> using namespace std; int main() { string imie="Valeriia"; //zakoduj powyższy łańcuch znaków int rozmiar=imie.length(); cout<<rozmiar<<"\n"; for(int i=0; i<rozmiar; i++) { cout<<(int)imie[i]<<" ";

ascll

C++
4 weeks ago
#include <iostream> using namespace std; int main() { //zamiana kodu ascll znak char znak; znak= 'j'; cout<<(int)znak<<"\n"; //zamiana znaku z tablicy int kod_ascll;

zamiana wielkości znaków w łańcuchach

C++
1 month ago
#include <iostream> #include <string> #include <algorytm> using namespace std; int main() { string napis="Ala ma kota"; transform(napis.begin(), napis.end(), napis.begin(,::toupper); cout<<napis<<end; transform(napis.begin(), napis.end(), napis.begin(,::tolower); cout<<napis<,end;

polePrzezWartosc funkcja

C++
2 months ago
#include <iostream> using namespace std; float polePrzezWartosc(float a,float b); // Prototyp funkcji (naglowek funkcji) polePrzezWartosc int main() { cout << "Program oblicza pole prostokata na 4 sposoby." << endl; //Wczytanie danych od uzytkownika float bokA, bokB; cout << "Podaj bok a (a>0): "; cin >> bokA; cout << "Podaj bok b (b>0): ";

roznica

C++
3 months ago
#include <iostream> using namespace std; int main() { int odjemne, odjemnik, roznica; do{ cout << "Podaj odjemna: "; cin >> odjemna; cout << "Podaj odjemnik: "; cin >> odjemnik;

wybor.case

C++
5 months ago
#include <iostream> #include <cmath> using namespace std; int main() { int wybor; //wybor z menu //menu cout<<"1-pole trojkata rownobocznego boku a \n";

substancje

C++
6 months ago
#include <iostream> #include <string> using namespace std; int main() { //Punkty topienia substancji (w °C) const double TOPIENIE_ALKOHOL = -114.0; const double TOPIENIE_RTEC = -39.0; const double TOPIENIE_TLEN = -218.0;

trójkąt

C++
6 months ago
#include <iostream> #include <cmath> using namespace std; int main() { float a, h; cout << "podaj d1. podstawy t. a="<<end1; cin >> a; cout << "podaj wysokosc t. h="<<end1;

pierwiastek

C++
6 months ago
#include <iostream> #include <cmath> using namespace std; int main() { float x, p; //x-liczba podpierwiastkowa, p-wynik pierwiastkowania cout << "podaj x: "; cin >> x; if(x < 0)