E D R , A S I H C RSS

김상윤

Zeropage 03

Profile


  • 이름 : 김상윤

  • 학번 : 03

  • 연락처 : 019-9236-4563

  • 이메일 : yuniboy1@hanmail점net

목표


계획


진행중


하고싶은 말


  • ㅡㅡ??
  • 구기종목듣자~~~
  • 시끄러..............인간관계심리나

ㅡㅡ


~cpp    
 
#include <iostream>   
#include <ctime>  
using namespace std;  
 
int main()  
{    
        cout<<"야구게임입니다.\n"; 
        srand(time(0));  
        int a = rand()%10; 
    int b = rand()%10; 
        int c = rand()%10; 
 
        while ( a==b || b==c || a==c) 
        {       a = rand()%10; 
            b = rand()%10; 
                c = rand()%10; 
        } 
         
        cout << a << b << c << endl; 
         
{ 
 
        int j,k;         
do 
{ 
        int i; 
        cout<<"숫자를 입력하시오\n"; 
    cin>>i; 
         
         j = 0; 
         
        if(i/100 == a) 
                j++; 
        if((i / 10) % 10 == b) 
                j++; 
        if(i % 10 == c) 
                j++;     
 
     k = 0; 
 
        if(i / 100 == b || i / 100 == c) 
                k++; 
        if((i / 10) % 10 == a || (i / 10) % 10 == c ) 
                k++; 
        if(i % 10 ==a || i % 10 ==b ) 
            k++; 
         
        cout << j << "S" << endl; 
        cout << k << "B" << endl; 
 
} while(j!=3); 
         
} 
 
 
  return 0; 
 
 
 
}        

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:28:48
Processing time 0.0176 sec