1 2 3 4 5 6 7 8 9 10 11 12 |
#include <iostream> using namespace std; int main() { int num_a,num_b; int line_1, line_2, line_3, sum; cin >> num_a >> num_b; line_1 = num_a * (num_b % 10); line_2 = num_a * ((num_b - (num_b % 10)) / 10 % 10) * 10;// line_3 = num_a * ((((num_b - (num_b % 10)) / 10) - ((num_b - (num_b % 10)) / 10 % 10)) / 10) * 100; sum = line_1 + line_2 + line_3; cout << line_1 <<endl<<line_2 / 10<<endl<< line_3/100 << endl << sum; } |
cs |
백준 2588
2019. 5. 31. 14:42