Files
license-verify/license-verifier.cpp
T
hellisabove bed67a3418 Added source
2023-03-26 23:54:43 +03:00

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;
}