<!DOCTYPE html> <html> <title>Web Page Design</title> <head> <style type="text/css"> div { width:100px; height:75px; background-color:red; border:1px solid black; } #div2 { transform:rotate(30deg); -ms-transform:rotate(30deg); /* IE 9 */ -moz-transform:rotate(30deg); /* Firefox */ -webkit-transform:rotate(30deg); /* Safari and Chrome */ -o-transform:rotate(30deg); /* Opera */ background-color:yellow; } </style> </head> <body> <div>Hello, World!</div> <div id="div2">Hello, CSS3!</div> </body> </html>
public class HelloWorld{ public static void main(String []args){ System.out.println("Hello World"); } }
#include <iostream> //#include "Celular.h" #include "ArrCelular.h" //El archivo ArrCelular llama al Celular.h //#include "ListaCelular.h" using namespace std; int main() { CArrCelular* arreglo; //Crea un objeto del tipo arreglo arreglo = new CArrCelular();//el objeto es de tipo PUNTERO CCelular* objDinamic1 = new CCelular((char*)("Black Berry"), 94653212, 13246789); arreglo->insertar(objDinamic1); // Método ... se usa -> porque es Puntero CCelular* objDinamic2 = new CCelular((char*)("LG"), 94653214, 13246789); arreglo->insertar(objDinamic2); //Cout arreglo cout << arreglo->recuperar(0)->getMarca() << " " << //devuelve el OBJETO celular arreglo->recuperar(0)->getNumero() << " " << arreglo->recuperar(0)->getImei() << " " << endl; CCelular* tmp; tmp = arreglo->recuperar(1); //cout<<tmp->getMarca() cout << "Marca : " << tmp->getMarca() << " Num : " << tmp->getNumero() << " Imei : " << tmp->getImei() << endl; cout << "La cantidad de celulares es: " << arreglo->getLongitud()<< endl; cout << "La posición del Nro de celular en el arreglo es: " << arreglo->buscar(94653212) << endl; arreglo->eliminarPorPosicion(0); cout << "La cantidad de celulares es: " << arreglo->getLongitud()<< endl; arreglo->eliminarTodo(); cout << "La cantidad de celulares es: " << arreglo->getLongitud()<< endl; getchar();
public class HelloWorld{ public static void main(String []args){ System.out.println("Hello World"); } }
10 DIM A(9),B(9) 12 PRINT "CALCULATING ... "; 15 FOR L = 1 TO 9:A(L) = 0:B(L) = 0: NEXT L:A(1) = INT ( RND (1) * 9) + 1:B(A(1)) = 1: FOR K = 2 TO 9 50 A(K) = INT ( RND (1) * 9) + 1: IF B(A(K)) = 1 THEN 50 60 B(A(K)) = 1: NEXT K: FOR J = 1 TO 9: NEXT J:G = A(1) * 10 + A(2): IF G = INT (G / 2) * 2 THEN 340 330 GOTO 15 340 F = A(1) * 100 + A(2) * 10 + A(3): IF INT (F / 3) * 3 <> F THEN 15 370 E = A(1) * 1000 + A(2) * 100 + A(3) * 10 + A(4): IF INT (E / 4) * 4 <>E THEN 15 400 A(5) = 5 430 C = A(1) * 100000 + A(2) * 10000 + A(3) * 1000 + A(4) * 100 + A(5) * 10 + A(6): IF INT (C / 6) * 6 <> C THEN 15 470 B = A(1) * 1000000 + A(2) * 100000 + A(3) * 10000 + A(4) * 1000 + A(5) * 100 + A(6) * 10 + A(7): IF INT (B / 7) * 7 <> B THEN 15 500 A = A(1) * 10000000 + A(2) * 1000000 + A(3) * 100000 + A(4) * 10000 + A(5) * 1000 + A(6) * 100 + A(7) * 10 + A(8): IF INT (A / 8) * 8 <> A THEN 15 510 R = A(1) * 100000000 + A(2) * 10000000 + A(3) * 1000000 + A(4) * 100000 + A(5) * 10000 + A(6) * 1000 + A(7) * 100 + A(8)*10 + A(9): IF INT (R / 9) * 9 <> R THEN 15 530 PRINT : PRINT "ANSWER FOUND !" 540 FOR M = 1 TO 9: PRINT A(M);" ";: NEXT M 600 end
#include <iostream> using namespace std; int main() { cout << "Hello World" << endl; return 0; }
<!DOCTYPE html> <html> <title>Web Page Design</title> <head> <script> function sayHello() { document.write("Hello, Coding fgbfxbx!"); } sayHello(); </script> </head> <body> </body> </html>
package com.zetcode; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Image; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import javax.swing.ImageIcon; import javax.swing.JPanel; import javax.swing.Timer; public class Board extends JPanel implements ActionListener { private final int B_WIDTH = 300; private final int B_HEIGHT = 300; private final int DOT_SIZE = 10; private final int ALL_DOTS = 900; private final int RAND_POS = 29; private final int DELAY = 140; private final int x[] = new int[ALL_DOTS]; private final int y[] = new int[ALL_DOTS]; private int dots; private int apple_x; private int apple_y; private boolean leftDirection = false; private boolean rightDirection = true; private boolean upDirection = false; private boolean downDirection = false; private boolean inGame = true; private Timer timer; private Image ball; private Image apple; private Image head; public Board() { addKeyListener(new TAdapter()); setBackground(Color.black); setFocusable(true); setPreferredSize(new Dimension(B_WIDTH, B_HEIGHT)); loadImages(); initGame(); } private void loadImages() { ImageIcon iid = new ImageIcon("dot.png"); ball = iid.getImage(); ImageIcon iia = new ImageIcon("apple.png"); apple = iia.getImage(); ImageIcon iih = new ImageIcon("head.png"); head = iih.getImage(); } private void initGame() { dots = 3; for (int z = 0; z < dots; z++) { x[z] = 50 - z * 10; y[z] = 50; } locateApple(); timer = new Timer(DELAY, this); timer.start(); } @Override public void paintComponent(Graphics g) { super.paintComponent(g); doDrawing(g); } private void doDrawing(Graphics g) { if (inGame) { g.drawImage(apple, apple_x, apple_y, this); for (int z = 0; z < dots; z++) { if (z == 0) { g.drawImage(head, x[z], y[z], this); } else { g.drawImage(ball, x[z], y[z], this); } } Toolkit.getDefaultToolkit().sync(); } else { gameOver(g); } } private void gameOver(Graphics g) { String msg = "Game Over"; Font small = new Font("Helvetica", Font.BOLD, 14); FontMetrics metr = getFontMetrics(small); g.setColor(Color.white); g.setFont(small); g.drawString(msg, (B_WIDTH - metr.stringWidth(msg)) / 2, B_HEIGHT / 2); } private void checkApple() { if ((x[0] == apple_x) && (y[0] == apple_y)) { dots++; locateApple(); } } private void move() { for (int z = dots; z > 0; z--) { x[z] = x[(z - 1)]; y[z] = y[(z - 1)]; } if (leftDirection) { x[0] -= DOT_SIZE; } if (rightDirection) { x[0] += DOT_SIZE; } if (upDirection) { y[0] -= DOT_SIZE; } if (downDirection) { y[0] += DOT_SIZE; } } private void checkCollision() { for (int z = dots; z > 0; z--) { if ((z > 4) && (x[0] == x[z]) && (y[0] == y[z])) { inGame = false; } } if (y[0] >= B_HEIGHT) { inGame = false; } if (y[0] < 0) { inGame = false; } if (x[0] >= B_WIDTH) { inGame = false; } if (x[0] < 0) { inGame = false; } if(!inGame) { timer.stop(); } } private void locateApple() { int r = (int) (Math.random() * RAND_POS); apple_x = ((r * DOT_SIZE)); r = (int) (Math.random() * RAND_POS); apple_y = ((r * DOT_SIZE)); } @Override public void actionPerformed(ActionEvent e) { if (inGame) { checkApple(); checkCollision(); move(); } repaint(); } private class TAdapter extends KeyAdapter { @Override public void keyPressed(KeyEvent e) { int key = e.getKeyCode(); if ((key == KeyEvent.VK_LEFT) && (!rightDirection)) { leftDirection = true; upDirection = false; downDirection = false; } if ((key == KeyEvent.VK_RIGHT) && (!leftDirection)) { rightDirection = true; upDirection = false; downDirection = false; } if ((key == KeyEvent.VK_UP) && (!downDirection)) { upDirection = true; rightDirection = false; leftDirection = false; } if ((key == KeyEvent.VK_DOWN) && (!upDirection)) { downDirection = true; rightDirection = false; leftDirection = false; } } } }
using static System.Console; public class Program { public static void Main() => WriteLine(new Cores(80, 20, 160)); } struct Cores { public byte R { get; } public byte G { get; } public byte B { get; } public Cores(byte r, byte g, byte b) { R = r; G = g; B = b; } public override string ToString() => $"{R}, {G}, {B}"; } //https://pt.stackoverflow.com/q/236022/101
<!DOCTYPE html> <html> <head> <style> h1{color: red;} #para_bold { font-weight: bold; } .para_smallfont {font-style: italic;;} </style> <title>Web Page Design</title> <script> function sayHello() { document.write("Hello, Coding Ground!"); } sayHello(); </script> </head> <body> <h1> Section 1</h1> <p id = "para_bold"> This paragraph will be in bold</p> <p class = "para_smallfont"> This is a smaller font paragraph</p> <p class = "para_smallfont" > this is another smaller font paragraph</p> <h1> Section 2</h1> </body> </html>
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more