BOJ 2588 곱셈

1 개요[ | ]

BOJ 2588 곱셈

2 C[ | ]

#include <stdio.h>
int main() {
	long a, b;
	scanf("%d %d", &a, &b);
    
    int b100 = b/100;
    int b10 = (b%100)/10;
    int b1 = b % 10;
    
    printf("%d\n", a*b1);
    printf("%d\n", a*b10);
    printf("%d\n", a*b100);
    printf("%d\n", a*b);
	return 0;
}

3 C++[ | ]

#include <iostream>
using namespace std;
int main() {
    int a, b;
    cin >> a >> b;
    int b100 = b/100;
    int b10 = (b%100)/10;
    int b1 = b % 10;
    cout << a*b1 << endl;
    cout << a*b10 << endl;
    cout << a*b100 << endl;
    cout << a*b << endl;
}
#include <iostream>
using namespace std;
int main() {
    int a, b;
    cin >> a >> b;
    int b100 = b/100;
    int b10 = (b%100)/10;
    int b1 = b % 10;
    cout << a*b1 << '\n';
    cout << a*b10 << '\n';
    cout << a*b100 << '\n';
    cout << a*b << '\n';
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}