Added source

This commit is contained in:
hellisabove
2023-03-26 23:54:43 +03:00
commit bed67a3418
+20
View File
@@ -0,0 +1,20 @@
#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;
}