holmespanda
BAN USER- 0of 0 votes
Answershow to use perl to write a script to deal with the comments in a C++ file?
- holmespanda in United States
let's say a file a.cpp, and it contains several comments. You have to remove the comments.
we know that in C++ there two kinds of comments // and /* */
i was trying to use the regex, but later i was stuck when i found that these comments can appear in a string, say "aaa // bbb", then it will be another situation.
can someone help me with this case?
any ideas will be helpful.| Report Duplicate | Flag | PURGE
Amazon Principal Software Engineer Perl - 12of 14 votes
Answerswe will name a number "aggregated number" if this number has the following attribute:
- holmespanda in United States
just like the Fibonacci numbers
1,1,2,3,5,8,13.....
the digits in the number can divided into several parts, and the later part is the sum of the former parts.
like 112358, because 1+1=2, 1+2=3, 2+3=5, 3+5=8
122436, because 12+24=36
1299111210, because 12+99=111, 99+111=210
112112224, because 112+112=224
so can you provide a function to check whether this number is aggregated number or not?| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm
i have tried several numbers, and it seems correct.
thanks.
Repmariacbrister, Graphics Programmer at Graphic Systems
Hey, I am Maria and I am from Bluefield. Currently, I work as a freelancer graphic artist. From an early ...
ps -fu username
- holmespanda November 20, 2012get the process id
kill id