thread269-1703513
What is the best way to store a simple date.
Should I just store it as a String or should I go through the process of using java.util.calendar or something similar?
I found this code on the internet and is a good example to work with dates
import java.util.Calendar;
import...
someone asked how to calculate the perfect numbers until 100 .And know I don't find that person. But here it is .
%generate all perfect number until 100...
%Create perfect numbers
%divisible(10,2).
divisible(X,Y):- N is Y*Y,N =< X,X mod Y =:= 0.
divisible(X,Y):- Y < X, Y1 is Y + 1...
Someone asked how to calculate the perfect numbers until 100 .And know I don't find that person. But here it is
%generate all perfect number until 100...
%Create perfect numbers
%divisible(10,2).
divisible(X,Y):- N is Y*Y,N =< X,X mod Y =:= 0.
divisible(X,Y):- Y < X, Y1 is Y + 1...
how to proced with the empty lists in this case?
%Multiply elements of one list
multLista([],1).
multLista([E|T],R):-multLista(T,Multiplica),R is Multiplica*E.
~
ex:
multLista([1,2,3,4],R).
R=24
multLista([],1).
R= 1 !!!!
Thanks
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.