Answers for "Can I convert python code to C++?"

0

Can I convert python code to C++?

list=[200500,999508,10003,204090,9876987]
index_list=[]
for i in list:
  n=0
  i=str(i)
  
  for j in range(len(i)-3):
    if i[j]==str(0):
      if i[j]==i[j+1]==i[j+2]==i[j+3]:
        n+=4
      elif i[j]==i[j+1]==i[j+2]:
         n+=3
      elif i[j]==i[j+1]:
        n+=2
  index_list.append(n)
Posted by: Guest on July-06-2021

Code answers related to "Can I convert python code to C++?"

Python Answers by Framework

Browse Popular Code Answers by Language