过不了编译。。。
  • 板块灌水区
  • 楼主封禁用户
  • 当前回复5
  • 已保存回复5
  • 发布时间2022/1/21 21:54
  • 上次更新2023/10/28 11:37:16
查看原帖
过不了编译。。。
418733
封禁用户楼主2022/1/21 21:54

我不李姐:

#include<bits/stdc++.h>
#define bug cout<<"bug"
#define ll long long
#define ull unsigned long long
using namespace std;
map<string,map<string,int> >mp;
string j2,j3;
int n,j4;
int q;
int main() {
	scanf("%d",&q);
	while(q--) {
		scanf("%d",&n);
		for(int i=0; i<n; ++i) {
			cin>>j3>>j2>>j4;
			mp[j3][j2]+=j4;
		}
		map<string,map<string,int> >::iterator it=mp.begin();
		for(; it!=mp.end(); ++it) {
			cout<<it->first<<endl;
			map<string,map<string,int> >::iterator it2=(it->second).begin();
			for(; it2!=(it->second).end(); ++it2) {
				cout<<"   |----"<<it2->first<<"("<<it2->second<<")"<<endl;
			}
		}
		m.clear;
		printf("\n");
	}
	
	return 0;
}

2022/1/21 21:54
加载中...