Skip to content

Instantly share code, notes, and snippets.

View StaniTr's full-sized avatar

Stanislava StaniTr

  • Bulgaria
View GitHub Profile
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import javax.swing.text.StyledEditorKit.ForegroundAction;
public class Problem1 {
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
class Program
{
static void Main()
{
//The program reads the content of a text file and write its words into one column in a new file.
//function calcSircleArea(r) - func with parameter r (radius)
function calcCircleArea(r){
//area
var area=Math.PI*r*r;
return area;
//console.log(arguments); --prints arguments of the function
}
//Функция, която да превръща kw в hp (конски сили)
//Вариант 1
function convert_v1(kw_v1){
var hp_v1=Math.round((kw_v1/0.746)*100)/100;
return hp_v1;
}
console.log("Вариант3");
console.log(convert_v1(75));
console.log(convert_v1(150));
<?php
// Overview: Find the regular expr. (preg_replace_callback) => func. "articles" => $match1=topic; $match2=author; $realMonth=month; $print=article summary
$text=$_GET['text'];
function articles($matches){
// $print contains article summary
if (strlen($matches[4])>100){
$str=substr((trim($matches[4])),0,100);
$print=htmlspecialchars($str)."...";
}else{
import java.util.Scanner;
public class Exam_Task1 {
public static void main(String[] args) {
//keeps num of eggs
int eggs=0;
//keeps num of dozens;
import java.util.Scanner;
public class Exam_Problem1_DozenEggs {
public static void main(String[] args) {
//keeps num of eggs
int eggs=0;
//keeps num of dozens;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Exam_Problem2_AddingAngles {
public static void main(String[] args) {
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;