int MinStudentLevel,CreditHours;
string Name,Code;
code=name+MinStudentLevel
يطلع عندي eror بسبب ان code هيا string وو MinStudentLevel هيا int ايش الحل معاها
في c++
أريد عمل رمز بسيط يبدأ بإدخال أحرف وأرقام عشوائية
ثم يقوم البرنامج بجمع الأرقام فقط
لدي مشكلة مع الجمع الناتج غلط
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
int main()
{
string serialcode="a98991G343m163R77Eqc\n";
int i=0;
int hjg;
cout<<serialcode;
int the_sum=0;
while (i<21)
{
if(isdigit(serialcode[i]))
the_sum+=serialcode[i];
i++;
}
cout<<the_sum;
return 0;
}