xxxxxxxxxx
#include<stdio.h>
int main()
{
double b1,h1,b2,h2,a1,a2;
scanf("%lf %lf %lf %lf",&b1,&h1,&b2,&h2);
a1=(b1*h1)/2;
a2=(b2*h2)/2;
if(a1>a2)
printf("%0.2lf",a1);
else
printf("%0.2lf",a2);
}
xxxxxxxxxx
# Importing
import sklearn
from sklearn.datasets import load_boston
import pandas as pd
import matplotlib.pyplot as plt
# Load the dataset
bos_hou = load_boston()
# Create the dataframe
column_name = bos_hou.feature_names
df_boston = pd.DataFrame(bos_hou.data)
df_boston.columns = column_name
df_boston.head()
xxxxxxxxxx
"""
coronavirus
3
abcde
crnas
onarous
"""
# Iterative Python program to check if a
# string is a subsequence of another string
# Returns true if str1 is a subsequence of str2
def main(str1, str2):
m = len(str1)
n = len(str2)
j = 0 # Index of str1
i = 0 # Index of str2
# Traverse both str1 and str2
# Compare the current character of str2 with
# first unmatched character of str1
# If matched, then move ahead in str1
while j < m and i < n:
if str1[j] == str2[i]:
j = j+1
i = i + 1
# If all characters of str1 matched,
# then j is equal to m
return j == m
# Driver Program
str2 = str(input())
N = int(input())
for i in range(N):
str1 = str(input())
if main(str1, str2):
print("POSITIVE")
else:
print( "NEGATIVE")
xxxxxxxxxx
#include <stdio.h>
int main()
{
int n,np=0,i,j,flag=0;
scanf("%d",&n);
for(i=2;i<=n;i++)
{
for(j=1,flag=0;j<=i;j++)
{
if(i%j==0)
flag++;
}
if(flag==2)
np++;
}
int total=n-2+1;
for(i=total/2;i>=1;i--)
if(total%i==0&&np%i==0)
{
total/=i;
np/=i;
}
printf("%d/%d",np,total);
return 0;
}
xxxxxxxxxx
#include <stdio.h>
int main()
{
char name [20] = "Lakshmisprasad";
char email [40]="lakshmiprasad018@gmail.com";
char slack[10]="@lakshmip";
char twitter[20]="Lakshmip2798";
char biostack [20]="Functional Genomics";
printf("name:%s\nemail:%s\ntwitter:%s\nbiostack:%s\nslack:%s\n",name,email,twitter,biostack, slack );
return 0;
}
xxxxxxxxxx
float(input("Digite quantos litros você quer abastecer: "))
input("Digite A para álcool ou G para gasolina: ")
if combustivel == "A" or combustivel == "a":
preco = litros * 1.9
if litros <= 20:
preco -= 1.9 * litros * 3 / 100
else:
preco -= 1.9 * litros * 5 / 100
elif combustivel == "G" or combustivel == "g":
preco = litros * 2.5
if litros <= 20:
preco -= 2.5 * litros * 4 / 100
else:
preco -= 2.5 * litros * 6 / 100
print(f"O preço a pagar é R${preco:.2f}")
xxxxxxxxxx
#include <stdio.h>
#include <string.h>
int mylen(char *n);
int mylen(char *n)
{
int count=0;
for(int i=0; n[i]!='\0'; i++){
count++;
}
printf("count=%d",count);
return count;
}
int main(void){
char name[20];
printf("enter name:\n");
scanf("%s",&name);
puts(name);
int len = mylen(name);
printf("length = %d",len);
return 0;
}
xxxxxxxxxx
s=input()
x= int(input())
unt = 0
n = 0
1=len(s)
f= False
for i in range(1) : n=n*10+int (s[i])
if n<=x:
print (n)
f=True
else:
if f:
count += 1 n=int(s[i]) f= False
if n<=x:
f = 7 True
else:
n = 0
if f= True: count +=1
print(count)
xxxxxxxxxx
void motor_set_position_sync(WbDeviceTag tag_motor, WbDeviceTag tag_sensor, double target, int delay) {
const double DELTA = 0.001; // max tolerated difference
wb_motor_set_position(tag_motor, target);
wb_position_sensor_enable(tag_sensor, TIME_STEP);
double effective; // effective position
do {
if (wb_robot_step(TIME_STEP) == -1)
break;
delay -= TIME_STEP;
effective = wb_position_sensor_get_value(tag_sensor);
} while (fabs(target - effective) > DELTA && delay > 0);
wb_position_sensor_disable(tag_sensor);
}
xxxxxxxxxx
#Importting csv module
import csv
#csv file name
filename= "aapi.csv"
# intiliaze titles and rows
fields =0
rows = 0
# reading csv file
with open(filename,'r') as csvfile:
# extract each data row one by one
csvreader=csv.reader(csvfile)
rows.append(rows)
# get total no of rwos
print("Total no of rows:%d%(csvreader.line_num)")
# print fields name
print('Field names are:' + ', '.join(field for field in fields))
# print first 5 rows
print('\n First 5 rows are:\n')
for row in rows[:5]:
# parsing each column of rows
for col in row:
print("%10s"%col),
print('\n')
xxxxxxxxxx
let eval_var variable liste =
let rec aux = function
| [] -> false
| h::t -> variable = h || aux t
in
aux liste;;