
16-11-2006, 08:34
|
|
|
|
חבר מתאריך: 25.06.06
הודעות: 16
|
|
חסר לך נקודה פסיק בלולאת פור.. בכל מקרה, היא מגעילה מדי בגלל האורך שלה, לא עובדים ככה.
קוד:
constint jumps=2; // the jumps between the chars (a to c = 2)
char ch; // char from the user
int count=1; // spot of the char (a=1,b=2);
char p_ch; // char that will print to the screen
cin>>ch;
for(p_ch='a';p_ch<=ch;p_ch+=jumps) // run over the chars
{
for(int i=0;i<count;i++) // print the char 'count' time
{
cout<<p_ch;
}
cout<<endl;
count+=jumps; // inc count by jumps (in this case 2)
}
_____________________________________
מקלדות לא כותבות באגים. יש אנשים שכותבים אותם.
"כאשר כולם חושבים בצורה זהה - זה סימן שאיש אינו חושב."
|