C++ cin cout

자료실

C++ cin cout

소프트웨어과 5 1,265 2023.03.14 14:07

#include<iostream>

#include<string>


using namespace std;


int main()

{

string str1, str2, str3;

cout << "주어: ";

cin >>  str1;

cout << "동사: ";

cin >>  str2;

cout << "목적어: ";

cin >>  str3;

 cout << str1 <<" " << str2 << " a " << str3; 

 return 0;

}

Comments

소프트웨어과 2023.03.17 15:23
#include<iostream>
#include<string>

using namespace std;

int main()
{
int H=0, M=0, S=0;
cout << "시: ";
cin >>  H;
cout << "분: ";
cin >>  M;
cout << "초: ";
cin >>  S;
  cout <<  "\n전체 초: " << ((H * 3600)+(M * 60)+ S);
  return 0;
}
소프트웨어과 2023.03.14 16:41
#include<iostream>
#include<string>
#include<math.h>

using namespace std;

int main()
{
const float py=3.3058;
float M=0;
cout << "평: ";
cin >>  M;
  cout << "평방미터:  " << M*py;
    return 0;
}
소프트웨어과 2023.03.14 16:32
#include<iostream>
#include<string>
#include<math.h>

using namespace std;

int main()
{
int L=0, W=0, H=0;
cout << "길이: ";
cin >>  L;
cout << "너비: ";
cin >>  W;
cout << "높이: ";
cin >>  H;

  cout <<  "\n상자의 부피:  " << L*W*H;
  cout <<  "\n상자의 표면적:  " << 2*((L*W)+(L*H)+(H*W));
return 0;
}
소프트웨어과 2023.03.14 16:25
#include<iostream>
#include<string>
#include<math.h>

using namespace std;

int main()
{
int a=0, b=0;
cout << "첫 번째 변: ";
cin >>  a;
cout << "두 번째 변: ";
cin >>  b;
  cout <<  "\n빗변 길이: " << sqrt(pow(a,2)+pow(b,2));
  return 0;
}
소프트웨어과 2023.03.14 14:14
#include<iostream>
#include<string>

using namespace std;

int main()
{
int age;
cout << "나이: ";
cin >>  age;
age +=10;
  cout <<  "10년 후에는 " << age <<"살이 됩니다. ";
  return 0;
}
Category
반응형 구글광고 등
State
  • 현재 접속자 44 명
  • 오늘 방문자 1,308 명
  • 어제 방문자 1,371 명
  • 최대 방문자 2,863 명
  • 전체 방문자 426,729 명
  • 전체 게시물 6,595 개
  • 전체 댓글수 129 개
  • 전체 회원수 31 명
Facebook Twitter GooglePlus KakaoStory NaverBand