Skip to content

Instantly share code, notes, and snippets.

@EugenyB
EugenyB / Main.java
Created April 8, 2016 09:48
e-olymp.com problem's 4739 solution
import java.util.Scanner;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println(IntStream.range(Math.max(in.nextInt(), 2), in.nextInt() + 1)
.filter(t -> IntStream.range(2, (int) Math.sqrt(t) + 1).noneMatch(d -> t % d == 0)).mapToObj(Integer::toString)
.collect(Collectors.joining(" ")));
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<!--
Заполнить данные - см.комментарии
-->
<resources>
<!-- имя пула (заменить poolname), например java:app/db_pool-->
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false"
connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10"
connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0"
#include <iostream>
#include <cstring>
#include <windows.h>
using namespace std;
struct date //создаем еще одну структуру, чтобы вложить ее в структуру building // дата постройки
{
char month[4]; // Месяц постройки дома
int year; // Год
#include <iostream>
#define N 2000
void process(int n);
void set0(int k[N]);
void set1(int k[N]);
@EugenyB
EugenyB / glassfish-web.xml
Created December 12, 2015 10:07
Пример файла glassfish-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
<class-loader delegate="true"/>
<jsp-config>
<property name="keepgenerated" value="true">
<description>Keep a copy of the generated servlet class' java code.</description>
</property>
</jsp-config>
<locale-charset-info default-locale="">
@EugenyB
EugenyB / persistence.xml
Created December 12, 2015 10:03
persistence.xml с созданием таблиц, если нужно
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="WebAppPU" transaction-type="JTA">
<jta-data-source>jdbc/library</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="javax.persistence.schema-generation.database.action" value="create"/>
</properties>
</persistence-unit>
</persistence>
int main()
{
}
#include <iostream>
using namespace std;
int main() {
int k, n;
cin >> n >> k;
int t = n * 2 / k;
if (n*2 % k > 0) t++;
t *= 2;
package logic;
import java.util.*;
/**
*
* @author Eugeny
*/
public class Practice {
package lesson6;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;