#include <iostream>
#include <string>
int main()
{
std::string fullName;
{
std::cout << "Type your full name: ";
}
std::cin >> fullName;
{
std::cout << "Your name is: " << fullName;
}
}
#include <iostream>
#include <string>
int main()
{
std::string fullName;
{
std::cout << "Type your full name: ";
}
std::getline(std::cin, fullName);
{
std::cout << "Your name is: " << fullName;
}
}
OVI ISTO; U CEMU JE BIT?
#include <string>
#include <iostream>
int main()
{
std::string rijec;
std::cin >> rijec;
for (int broj = 0; broj < rijec.size(); broj++)
{
std::cout << rijec.at(broj) << "\n";
}
}
#include <string>
#include <iostream>
int main()
{
std::string rijec;
std::getline(std::cin, rijec);
for (int broj = 0; broj < rijec.size(); broj++)
{
std::cout << rijec.at(broj) << "\n";
}
}
NI OVDJE
#include <iostream>
int main () {
char name[256], title[256];
std::cout << "Please, enter your name: ";
std::cin.getline (name,256);
std::cout << "Please, enter your favourite movie: ";
std::cin.getline (title,256);
std::cout << name << "'s favourite movie is " << title;
return 0;
}
#include <iostream>
int main() {
char name[256], title[256];
std::cout << "Please, enter your name: ";
std::cin >> name;
std::cout << "Please, enter your favourite movie: ";
std::cin >> title;
std::cout << name << "'s favourite movie is " << title;
return 0;
}
I JEDAN I DRUGI KOD ISPISUJU ISTO
OVI ISTO; U CEMU JE BIT?
NI OVDJE