12345678910111213141516171819202122232425262728 |
- #include<iostream>
- class Per {
- public:
- double score;
- Per(double s) { this->score = s; }
- Per() {}
- };
- struct KV {
- public:
- int key;
- int value;
- Per p;
- KV(int key, int value, Per p) :key(key), value(value), p(p) {}
- KV() {}
- };
- int main() {
- KV tmp = {
- 1,2,Per(6.0)
- };
- KV tmp2 = {
- .key = 3,
- .value = 2,
- .p = {
- 6
- }
- };
- }
|