SHARE
TWEET

Untitled

a guest Apr 26th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void preveriDavcno(string davcna){
  6.     int zmnozek=0, sestevek=0, j=2;
  7.     for(int i=6; i>=0; i--){
  8.         zmnozek=zmnozek+(davcna[i]-48)*j;
  9.         j++;
  10.     }
  11.     sestevek=zmnozek+(davcna[7]-48);
  12.     cout << sestevek;
  13.     if(sestevek%11==0){
  14.         cout << "Vpisali ste davcno st.: " << davcna << endl;
  15.         cout << "Davcna stevilka je veljavna!";
  16.     }
  17.     else{
  18.         cout << "Vpisali ste davcno st.: " << davcna << endl;
  19.         cout << "Davcna stevilka ni veljavna!";
  20.     }
  21. }
  22.  
  23. int main()
  24. {
  25.     preveriDavcno("56636393");
  26.     return 0;
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top