Uuuuuh i can't read digraphs and trigraphs. So with help of wikipedia i replaced all di/trigraphs into usual symbols.
1. put the struct right before the loop
2. deleted the useless lambda in loop-body [](){}();
3. changed decltype(l::i) to int
4. renamed l to structType
5. renamed j to obj
6. removed *& in obj.i%*&obj.k
so, this is much more readable now:
Code: Select all
#include <iostream>
using namespace std;
int main()
{
struct structType
{
int i,k;
};
for(
structType obj=[]()
{
int i,j;
cin>>i>>j;
return structType {i,j};
}();
obj.k != 0;
obj= {obj.k, obj.i%obj.k}, obj.k
? cout
: cout<<obj.i<<endl
)
{
}
return 0;
}
next a little more restructuring.
7. renamed i and k into first and second
8. defined obj before the loop without lampda-crap
Code: Select all
#include <iostream>
using namespace std;
int main()
{
struct structType
{
int first,second;
};
structType obj;
cin>>obj.first>>obj.second;
for(
;
obj.second != 0
;
obj = {obj.second, obj.first%obj.second},
obj.second ? cout : cout<<obj.first<<endl
)
{}
return 0;
}
so and now trying to understand.
the loop-update part sets first = second and second = first%second.
when second==0 then first will be printed and the loop ends.
so due to this algorithm i think this programm calculates the greatest common divisor for first and second with euclid's algorithm