commit bed67a3418a4f88a0be6fe9575d42b3b9427c353 Author: hellisabove <59116609+hellisabove@users.noreply.github.com> Date: Sun Mar 26 23:54:43 2023 +0300 Added source diff --git a/license-verifier.cpp b/license-verifier.cpp new file mode 100644 index 0000000..8c9f6aa --- /dev/null +++ b/license-verifier.cpp @@ -0,0 +1,20 @@ +#include +#include +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; +}