quinta-feira, 29 de agosto de 2019

L1 ex 3

#include <iostream>
#include <stdlib.h>
using namespace std;

int main() {
int a,b,x;
// matheus nakade
// L1 ex3
cout<<"Vamos descobrir se 2 numeros sao divisiveis"<<endl;
cout<<"Digite o primeiro numero"<<endl;
cin>>a;
cout<<"Digite o segundo numero"<<endl;
cin>>b;

x = a % b;




if(x == 0){
cout<<a<<" e divisivel por "<<b<<endl;

}

else{
cout<<a<<" ## Nao e divisivel por "<<b<<endl;

}



return 0;
}

L1 ex2

#include <iostream>
#include <stdlib.h>
using namespace std;

int main() {
int a,x;
// matheus nakade
// L1 ex2
cout<<"digite um numero vamos: "<<endl;
cout<<"descobrir se ele é multiplo de 3"<<endl;
cin>>a;
x = a % 3;




if(x == 0){
cout<<"# este numero e multiplo de 3 "<<endl;

}

else{
cout<<" ## nao multiplo de 3 "<<endl;

}



return 0;
}

L1 ex1

#include <iostream>
using namespace std;

int main() {
int a,b,c,z, w;
// matheus nakade
// L1 ex1
cout<<"digite o numero 1"<<endl;
cin>>a;
cout<<"digite o numero 2"<<endl;
cin>>b;

c = a + b;
z = c + 8;
w = c - 5;
if(c<=20){
cout<<" 1 + 2 <= 20 logo: "<<c<<" e menor ou igual a 20 logo: "<<c<<" - 5 = "<<w<<endl;

}

else{
cout<<" 1 com 2 > 20 logo: "<<c<<" e maior que 20 logo: "<<c<<" + 8 = "<<z<<endl;

}



return 0;
}

ss1

https://sites.google.com/site/ghunterp/

quarta-feira, 28 de agosto de 2019

a2

#include <iostream>
using namespace std;
int main() {

int a,b,c;

cin>>a;
cin>>b;
cin>>c;

if(a>=1 && a <=31  && b>=1  && b<=12 && c>=1900 && c<=2100) 
{
cout<<"Os dados estao corretos"<<endl;
}



if ((b==2 && a<=28))
{
cout<<" ### dia/mes Dados corretos "<<endl;
}
else if (b==4 || b==6 || b==9 || b==11 && a<=30)
{
cout<<" ### dia/mes Dados corretos "<<endl;
}

else
{
cout<<" @@@ dia/mes Dados incorretos man"<<endl;
}












 return 0;
}



#include <iostream>
using namespace std;
int main() {

int a,b,c;
cin>>a;
cin>>b;
cin>>c;
if((a>=1 && a <=31) && (b>=1  && b<=12)&& (c>=1900 && c<=2100)) 
{
cout<<"Os dados estao corretos"<<endl;
}
else
{
cout<<" ## os dados estao incorretos"<<endl;
}











 return 0;
}

#include <iostream>
using namespace std;
int main() {

int a,b,c;

cin>>a;
cin>>b;
cin>>c;

if((a>=1 && a <=31) && (b>=1  && b<=12)&& (c>=1900 && c<=2100)) 
{
cout<<"Os dados estao corretos"<<endl;

if ((b==2 && a<=28) || ((b==1) || (b==3) || (b==5) || (b==7) || (b==8) || (b==10) || (b==12) && a<=31) || (b==4) || (b==6) || (b==9) || (b==11) && a<=30)
{
cout<<" ### dia/mes Dados corretos "<<endl;
}
else
{
cout<<" @@@ dia/mes Dados incorretos man"<<endl;
}
}
else
{
cout<<" ## os dados estao incorretos"<<endl;
}











 return 0;
}

if ((b==1) || (b==3) || (b==5) || (b==7) || (b==8) || (b==10) || (b==12) && a<=31)
{
cout<<" ### dia/mes Dados corretos "<<endl;
}

else
{
cout<<" ## os dados estao incorretos"<<endl;
}