Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. //Check if there is a natural number i
  2. //by which t can be divided without rest
  3.  
  4. //This code should only executed if it has been determined above that ((t - 1) % 3 == 0) is false
  5.  
  6. int matchFound=0;
  7.  
  8. for (int i=1; i*i <= t; t++) { //Go through all natural numbers from 1 onwards
  9. //until i gets "too large"
  10.  
  11. if (i*i == t) matchFound=1; //If there is a natural number i that multiplied with itself is t,
  12. //t has an integer square root and is part of the function t=n²
  13. }
  14.  
  15. return matchFound; //returns 1 if t is part of the function t=n², 0 if not
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement