← Back to List

1225번: 이상한 곱셈 ↗

Solutions

C++14
233 B | 233 chars
#include <iostream>
#include <string>
using namespace std;
long long A,B;
string a,b; 
int main()
{
	cin>>a>>b;
	for(int x=0; x<a.length(); x++)
	{
		A+=a[x]-'0';
	}
	for(int x=0; x<b.length(); x++)
	{
		B+=b[x]-'0';
	}
	cout<<A*B;
}