السلام عليكم
كيفكم ؟
عدت من جديد وعندي كووم اسئلة
فجزاكم الله خير
لاتنسوني من مساعداتكم
لان برمجة 2 لحست مخي صح
وماانسى لكم جميلكم يوم كنتم تساعدوني ببرمحه 1
ودايم ادعي لكم :)
نبدا مع الاسئله
هذا الكود وش فايدته
#include <iostream>
using namespace std;
int main()
{
int num;
cout << "Enter a five-digit number: ";
cin >> num;
cout << num / 10000 << " ";
num = num % 10000;
cout << num / 1000 << " ";
num = num % 1000;
cout << num / 100 << " ";
num = num % 100;
cout << num / 10 << " ";
num = num % 10;
cout << num << endl;
return 0;
}#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
char str[80];
char token [80];
char *p,*q ;
cout <<"Enter a sentence : " ;
gets(str);
p=str;
//read a token at a time from the string
while (*p) // هذه الجزئيه ما فهمتها الى الاخير
{
q=token;
// read a characters until either a space or the null terminator is encountered
while (*p!=' ' && *p)
{*q= *p;
q++;p++;}
if(*p)p++; //advance past the space
q ='\0';//null terminate the token*
cout << token << endl;}
return 0;
}