Added source
This commit is contained in:
@@ -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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user