#!/bin/bash
res=0
read h1 m1 h2 m2
while :
do
if [ $m1 -eq 0 ]; then
if [ $h1 -gt 12 ]; then
dif=$(($h1-12))
else
[ $h1 -eq 0 ] && dif=12 || dif=$h1
fi
res=$(($res+$dif))
else
[ $m1 -eq 30 ] && ((res++))
fi
[ $h1 -eq $h2 ] && [ $m1 -eq $m2 ] && break
((m1++))
[ $m1 -eq 60 ] && m1=0 && ((h1++))
done
echo $res
#include <stdio.h>
void main() {
int N = 5, A[N], i;
for(i = 0; i < N; i++){
printf("Enter A[%d]\n", i);
scanf("%d", &A[i]);
}
printf("\nNumber of element\tValue\n");
for(i = 0; i < N; i++){
printf("A[%d]\t\t\t%d\n", i, A[i]);
}
int min = A[0], max = A[0];
for(i = 0; i < N; i++){
if(A[i] < min) min = A[i];
if(A[i] > max) max = A[i];
}
printf("min = %d\nmax = %d\n", min, max);
}