renton ([info]renton) wrote on May 3rd, 2006 at 12:07 am
#include
using namespace std;

char char_masivs[] = {'1','2','3','n','u','t','u','e','s','i','b','r','i','v','s','4','5','6','.','.','.'};
int summa = 0;
int main()
{
for (int i = 0; i < 21; i++){
if ((char_masivs[i] > '0') && (char_masivs[i] < '9')) {

// summa + simbola_skaitliska_vertiba
summa = summa + char_masivs[i] - '0';
}
}
cout << "Masivs ir: " << char_masivs << " Taja ciparu summa ir:" << summa << endl;
system("pause");
return 0;
}
 
( Read comments )
Post a comment in response:
From:
( )Anonymous- this user has disabled anonymous posting.
Username:
Password:
Subject:
No HTML allowed in subject
  
Message:

Notice! This user has turned on the option that logs your IP address when posting.