Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
import java.awt.geom.*;
public class elevator
{
static int floor = 0, choice1, person = 0;
public static void main(String args[])
{
floor = ((int) (Math.random() * 10 + 1));
System.out.println("The elevator is now on floor " +floor);
System.out.print("Which floor are you at now (0-10) where 0 = basement: ");
choice1 = Keyboard.readInt();
if(floor == choice1)
{
System.out.println("Enter the elevator");
}
else if(floor > choice1)
{
ElevatorDown();
}
else if(floor < choice1)
{
ElevatorUp();
}
System.out.println("To which floor would you want to go (0-10) where 0 = basement");
choice1 = Keyboard.readInt();
if(floor > choice1)
{
ElevatorDown();
}
else if(floor < choice1)
{
ElevatorUp();
}
}
public static void ElevatorUp()
{
System.out.println("The elevator is on it's way up...");
for (person = choice1; choice1>=floor; floor++)
System.out.println(floor);
System.out.println("The elevator has arrived");
}
public static void ElevatorDown()
{
System.out.println("The elevator is on it's way down...");
for (person = choice1; choice1<=floor; floor--)
System.out.println(floor);
System.out.println("The elevator has arrived");
}
}
# Hello World program in Python
import requests
result = requests.post('https://openapi.daocloud.io/v1/apps/28832ce5-0e21-42a2-8307-796a85045c3e/actions/restart',
headers={"Authorization": "token q4c67rdvmtmkgee4hwgr3efj2vj0ucw7v74qk6qk"})
print(result.json())
#include <stdio.h>
int main()
{
int n;
int m;
int cntr;
long long product;
FILE*ark = fopen("Tablas de Multiplicar.dat","w");
printf("¿Qué tabla de multiplicar desea conocer (Registre número)\n");
scanf("&d", m);
printf("¿Hasta qué número la desea calcular? (Registe número)\n");
scanf("%d", &n);
for (cntr = 1; n=1; n++)
{
product= m*n;
printf("%d %lld\n", cntr, product);
fprintf(ark, "%d %lld\n", cntr, product);
}
return 0;
}