الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

مساعده بسرعه لو سمحتوا

مغلق
بدأه المايدي في 29 يناير 2002 · 1 رد · 323 مشاهدة · في ارشيف قسم C/C++
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

اريد تصميم برنامج بلغة السي ++

يقوم كعداد لسطور الكود البرمجي الذي يدخله المستخدم وعرض رقم السطر بجانبه

شوفوا ها المساله ;)

input

to the program is a cpp source code file (the one specified interactively by the user).

output

a) a file which is the cpp file with line numbers prepended to lines of code (LOC)

B) a report to the console giving the counts of the number of LOC, blank lines, and comment lines.

For purposes of this project, the following terms are defined:

blank line = a line of zero or more whitespace characters

comment line = a line of zero or more whitespace characters followed by //

line of code = any other line in the program.

Assumptions allowed:

a line in a program will not exceed 100 characters

the program compiles

there will not be more than 99,999 lines in the input file

--------------------------------------------------------------------------------

Example Usage

In this example usage the text produced by the program is in bold.

input file: myprog.cpp

output file: myprog.txt

Lines of Code: 75

Comment Lines: 12

Blank Lines: 6

Total Lines: 93

--------------------------------------------------------------------------------

Example Input / Output

for this input file:

// author: djbouvier

// example program that does nothing useful

#include

void main (void) {

cout << "happy are those who comment their code n";

cout << endl; // the end

}

the following output should be produced

// author: djbouvier

// example program that does nothing useful

1 #include

2 void main (void) {

3 cout << "happy are those who comment their code n";

4 cout << endl; // the end

5 }

with the following counts

Lines of Code: 5

Comment Lines: 2

Blank Lines: 3

Total Lines: 10

ارجوا التكرم بسرعهههههههه الحقوني :confused:

#2

where are you guys helppppppppppp me please

هذا الموضوع مغلق.

مواضيع مشابهة