21 lines
464 B
C++
21 lines
464 B
C++
#include <iostream>
|
|
#include <string.h>
|
|
using namespace std;
|
|
char license[100];
|
|
|
|
int main(){
|
|
cout << "Please enter license: ";
|
|
cin >> license;
|
|
cout << "Checking License: " << license << "\n";
|
|
int sum = 0;
|
|
for(int i = 0;i < strlen(license); i++){
|
|
sum += (int)license[i];
|
|
}
|
|
if(sum==2015) {
|
|
cout << "License is valid!\n";
|
|
} else {
|
|
cout << "License is not valid! Maybe you made a typo?\n";
|
|
}
|
|
return 0;
|
|
}
|