Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

水题!最抽象的一件事是我交代码的时候,没删一行测试输出,为此还找了老师

Posted by sand_and_water at 2024-07-11 20:42:29 on Problem 3673
#include <iostream>
#include <cstring>
using namespace std;

string a, b;

int main(){
	cin >> a >> b;
	
	long long sum = 0;
//	cout << a.size()<< ' ' << b.size() << endl;
//	最抽象的一件事是我交代码的时候,没删这行测试输出
//	为此还找了老师
	for(int i = 0; i < a.size(); ++i){
		for(int j = 0; j < b.size(); ++j){
//			cout << (int)(a[i] - '0') << ' ' << (int)(b[j] - '0') << endl;
			sum += (int)(a[i] - '0') * (int)(b[j] - '0');
		}
	}	
	cout << sum << endl;
	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator