Skip to content
Snippets Groups Projects
Commit f5f83ee7 authored by Tomáš Pachman's avatar Tomáš Pachman
Browse files

Upload New File

parent 1ea13a36
No related branches found
No related tags found
No related merge requests found
#include <iostream> //+stdio.h v c++
#include <iomanip>
namespace A{
void foo(void){
std::cout << "Bar" << std::endl;
}
}
namespace B{
void foo(void){
std::cout << "Bar ale v B" << std::endl;
}
}
using namespace std;
namespace mujstd=std;
//+main stejne jako v c
int main(int argc, char *argv){
//+operator proudoveho zapisu <<
//+ cout vypis do terminalu
std::cout << "Hollo PPC" << std::endl;
A::foo();
B::foo();
cout << "Vypis bez std" << endl;
//+ cin nacteni z terminalu
int a,b;
cout << "Zadej dve cisla" << endl;
cin >> a >>b;
if(std::cin.good()){
cout << "Zadal jsi " << a << "a" << b << mujstd::endl;
}
else{
std::cout << "Zopakuj si datove typy" << std::endl;
cout << ((cin.rdstate() & ios_base::badbit) ? "B":"b");
cout << ((cin.rdstate() & ios_base::eofbit) ? "E":"e");
cout << ((cin.rdstate() & ios_base::failbit) ? "F":"f");
cout << endl;
}
double pi=3.14159;
std::cout<<pi<<std::endl;
std::cout<<std::setprecision(3)<<pi<<std::endl;
std::cout<<setw(10)<<pi<<std::endl;
std::cout<< std::fixed<<pi<<std::endl;
std::cout<<std::scientific<<pi<<std::endl;
std::string name;
std::cout<<
return 0;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment