- OLED TV topic
- Melyik tápegységet vegyem?
- Itt a Panther Lake és az Intel rendkívül sokat vár tőle!
- AMD Navi Radeon™ RX 9xxx sorozat
- Kormányok / autós szimulátorok topikja
- Intel Core Ultra 3, Core Ultra 5, Ultra 7, Ultra 9 "Arrow Lake" LGA 1851
- Projektor topic
- Dell notebook topic
- Intel Core i5 / i7 / i9 "Alder Lake-Raptor Lake/Refresh" (LGA1700)
- Házimozi belépő szinten
Új hozzászólás Aktív témák
-
cellpeti
nagyúr
igen!
Így néz ki a progi:
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
int getline(char s[],int lim){
int i,c;
for (i=0;i<lim && (c=getchar())!=EOF && c!='\n';++i)
s[i]=c;
s[i]='\0';
while (c!=EOF && c!='\n')
c=getchar();
return (i);
}
int lebege(char s[]){
int i=0, kezd;
while(isspace(s[i])) ++i;
if(s[i]=='+'||s[i]=='-') ++i;
kezd=i;
while(isdigit(s[i])) ++i;
if(s[i]=='.') ++i;
while(isdigit(s[i])) ++i;
if(i==kezd||kezd+1==i&&s[kezd]=='.') return 0;
if(toupper(s[i])=='E'){
++i;
if(s[i]=='+'||s[i]=='-')++i;
if(!isdigit(s[i])) return 0;
while(isdigit(s[i])) ++i;}
if(isspace(s[i])||!s[i]) return 1;
else return 0;
}
void main (void)
{
float r,T,K;
float pi=3.14;
char s[24];
int ok=1;
do
{
ok=1;
printf("Adja meg a kor sugarat!\n\n");
if(!getline (s,25))
{
printf("Üres sort adtal meg!\n\n");
ok=0;
}
else
{
if(!lebege(s))
{
printf("Nem lebegopontos a megadott szam!\n");
ok=0;
}
else
r=atof(s);
}
}while(ok==0);
K=2*r*pi;
T=r*r*pi;
printf("\nA kor kerulete: %.2f\n\nA kor terulete: %.2f\n\n",K,T);
getch();
}
Új hozzászólás Aktív témák
● olvasd el a téma összefoglalót!
● ha kódot szúrsz be, használd a PROGRAMKÓD formázási funkciót!
- Jo Nesbo: LEOPÁRD (nem olvasott)
- ÁRGARANCIA!Épített KomPhone i7 14700KF 32/64GB RAM RX 9070 16GB GAMER PC termékbeszámítással
- HIBÁTLAN iPhone 12 mini 128GB White -1 ÉV GARANCIA - Kártyafüggetlen, MS3467, 94% Akkumulátor
- LG 27UL500-W - 27" IPS - 3840x2160 4K - 60Hz 5ms - HDR10 - AMD FreeSync - 300 Nits - sRGB 99%
- Apple iPhone 15 Pro 256GB,Dobozával,12 hónap garanciával
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: Laptopműhely Bt.
Város: Budapest