AKB Forums

Go Back   AKB Forums > Technical sections > Languages, Compilers and Interpreters
Home Register Blogs FAQ Members List Calendar Downloads Arcade Mark Forums Read

Languages, Compilers and Interpreters C,C++,C#,.NET,Java,PHP,Perl,SQL and more

Troubles when posting message? Click here! :: Проблемы с отправлением сообщения? Нажмите сюда!

Reply
 
LinkBack Thread Tools Display Modes
Old Oct 15, 2006, 09:56  
Младенец
 
Join Date: May 2004
Location: usa
Posts: 35
Rep Power: 0
Reputation: 10
Vopros

privet
ya tut voprosi budu zadavat ,mojno? vcera nachal


kak mojno napisat chasi v C?

12:45:07

Code:
int main(){

	int a,b,c;
scanf("%d%d%d",&a,&b,&c);

printf("%d %d %d",a,b,c);
vidaet takuyu fignyu

Code:
12-858993460-858993460
centrino is offline   Reply With Quote Quote selected
Old Oct 17, 2006, 09:54   #16
Младенец
 
Join Date: May 2004
Location: usa
Posts: 35
Rep Power: 0
Reputation: 10
Quote:
Originally Posted by AvDav View Post
ti tam zakrivayushuyu skobku zabil, mojet iz-za etogo, xotya vryadli, opiat taki posmotri chto znachit oshibka kompiliatora C1004 v msdn-e
centrino is offline   Reply With Quote Quote selected
Old Oct 17, 2006, 10:31   #17
Дикообраз-безобраз
 
AvDav's Avatar
 
Join Date: Jul 2004
Location: У самого синего моря
Posts: 2,618
Rep Power: 5
Reputation: 82
Send a message via ICQ to AvDav
vashe kogda stavish skobki, srazu stav i otkrivayushuyu i zakrivayushuyu mejdu nimi pishi, a to esli budet code poslojnee vashe zaputaeshsya chto gde zabil, a tak ne zabudesh
__________________
Deutschland, Deutschland über alles
Über alles in der Welt,

Wenn es stets zu Schutz und Trutze
Brüderlich zusammenhält,

Von der Maas bis an die Memel,
Von der Etsch bis an den Belt.

AvDav is offline   Reply With Quote Quote selected
Old Oct 17, 2006, 20:34   #18
Лараян Арег
 
Lareg's Avatar
 
Join Date: Jul 2006
Location: на семи холмах
Posts: 4,042
Rep Power: 2
Reputation: 80
Send a message via ICQ to Lareg
Quote:
Originally Posted by AvDav View Post
vashe kogda stavish skobki, srazu stav i otkrivayushuyu i zakrivayushuyu mejdu nimi pishi, a to esli budet code poslojnee vashe zaputaeshsya chto gde zabil, a tak ne zabudesh
Лапусег, ну ты прям как наш школьный учитель информатики
__________________
Как много искр божьих загасил ветер в голове... (с)
Lareg is offline   Reply With Quote Quote selected
Old Oct 17, 2006, 20:52   #19
Дикообраз-безобраз
 
AvDav's Avatar
 
Join Date: Jul 2004
Location: У самого синего моря
Posts: 2,618
Rep Power: 5
Reputation: 82
Send a message via ICQ to AvDav
v otlichii ot nego ya "rabotayu" na volonterskoi osnove
__________________
Deutschland, Deutschland über alles
Über alles in der Welt,

Wenn es stets zu Schutz und Trutze
Brüderlich zusammenhält,

Von der Maas bis an die Memel,
Von der Etsch bis an den Belt.

AvDav is offline   Reply With Quote Quote selected
Old Oct 19, 2006, 07:00   #20
Младенец
 
Join Date: May 2004
Location: usa
Posts: 35
Rep Power: 0
Reputation: 10
kogda naprimer pishesh eto 13:45:36+04:22:54
to vixodit tak 18:8:30 vmesto 18:08:30
toje samoe 22:32:18+12:54:43 = 11:27:1
centrino is offline   Reply With Quote Quote selected
Old Oct 19, 2006, 08:12   #21
...overwined...
 
noone's Avatar
 
Join Date: Mar 2003
Location: ...tortuga...
Posts: 3,392
Rep Power: 6
Reputation: 140
%02d...
__________________
...let's be gods... let's by ugly...
noone is offline   Reply With Quote Quote selected
Old Oct 19, 2006, 08:16   #22
Младенец
 
Join Date: May 2004
Location: usa
Posts: 35
Rep Power: 0
Reputation: 10
cool ispasiba dabarish
a chto 02 oznochaet

eshe odna problema kogda viceslat nado tsifri 4:32:08-12:45:43
sec3=(sec1+60-sec2)%60;
min2=?
hour3=?

Last edited by centrino : Oct 19, 2006 at 09:41.
centrino is offline   Reply With Quote Quote selected
Old Oct 20, 2006, 11:50   #23
Младенец
 
Join Date: May 2004
Location: usa
Posts: 35
Rep Power: 0
Reputation: 10
ya napisal tolko s oshibkoy ,v outpute tolko Error: Invalid operator: * it can either be + or -

gde oshibka,pomogite

Code:
#include<stdio.h>
int main(){

	int hour1,min1,sec1,hour2,min2,sec2,hour3,min3,sec3;
	int overall_second1,overall_second2;
	char f,math_operator;
    scanf("%d%c%d%c%d%c%d%c%d%c%d",&hour1,&f,&min1,&f,&sec1,&math_operator,&hour2,&f,&min2,&f,&sec2);


        if(math_operator == '*'){
        if(hour1>=24)
                     printf("Error: Invalid hour:   %d",hour1);
            else if(min1>=60)
                     printf("Error: Invalid minute: %d",min1);
			else if(min2>=60)
				     printf("Error: Invalid minute: %d",min2);
			else if(sec1>=60)
				     printf("Error: Invalid second: %d",sec1);
			else if(sec2>=60)
				     printf("Error: Invalid second  %d",sec2);



            return 0;
        }
        else{
            printf("Error: Invalid math_operator: * it can either be + or -");
            
            return 0;
        }
    


switch (math_operator){

case '+':

	overall_second1=(hour1*3600+min1*60+sec1)+(hour2*3600+min2*60+sec2);

	hour3=overall_second1/3600;
	min3=(overall_second1%3600)/60;
	sec3=(overall_second1%3600)%60;
	break;

case '-':

	overall_second2=(hour1*3600+min1*60+sec1)-(hour2*3600+min2*60+sec2);

	hour3=overall_second1/3600;
	min3=(overall_second1%3600)/60;
	sec3=(overall_second1%3600)%60;
    break;

}

printf("%02d%c%02d%c%02d",hour3,f,min3,f,sec3);

return 0;

}
centrino is offline   Reply With Quote Quote selected
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vopros tomu/toy kto rabotaet v banke marsiamoon Law 4 Aug 28, 2006 04:31
vopros! ara aslanyan Web sites 7 Jan 26, 2006 11:59
Vopros avtorstva..! Arik Web sites 20 Dec 19, 2005 12:22
Vopros iz C++(Borland) Azabochenni Languages, Compilers and Interpreters 3 Jul 19, 2004 11:53
Небольшой вопрос к Armjanam, otvetniy vopros na vopros Arcmage u nas GURD History and Politics 72 Sep 2, 2002 07:24


All times are GMT. The time now is 04:55.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
This board was founded on September 29, 2001
Powered by Viper Internet

Affordable Web Hosting | ParevNet

Buy text link