+ 1

Redo From python to C++

import sys, math s1=sys.argv[1]; s1=int(s1); s2=sys.argv[2]; s2=int(s2); l=[]; ll=[] while s1 < s2+1: l.insert(-1,str(s1)) s1+=1 for i in l: if len(i) < 6: while len(i) < 6: i='0'+i; ll.insert(-1, i); del l[0:] for i in ll: if (int(i[0])+int(i[1])+int(i[2])) == (int(i[3])+int(i[4])+int(i[5])): l.append(i) print len(l)

21st Mar 2019, 9:32 AM
Insomnia
Insomnia - avatar
3 Antworten
0
Insomnia let me see if I understood: You want help in translating the python code to C++?
21st Mar 2019, 10:12 AM
Ulisses Cruz
Ulisses Cruz - avatar
+ 1
Please can we see your attempt first?
21st Mar 2019, 10:51 AM
Ulisses Cruz
Ulisses Cruz - avatar
0
yes
21st Mar 2019, 10:49 AM
Insomnia
Insomnia - avatar