Add student example inputs

This commit is contained in:
Alex Hirsch
2019-03-18 13:50:36 +01:00
parent 480716b4a9
commit 14da3497ed
45 changed files with 1245 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
/* is_squared returns true if a number is the square of any integer */
bool is_square(int n)
{
int i = 0;
while(i*i < n){
if(i*i == n){
return true;
}
i = i + 1;
}
return false;
}
int main()
{
print("Please enter a number: ");
print_nl();
int n;
n = read_int();
if(is_square(n)){
print("Yes");
}
else
{
print("No");
}
print_nl();
}

View File

@@ -0,0 +1 @@
16

View File

@@ -0,0 +1,2 @@
Please enter a number:
No