Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÓеÀÄÑÌâÁ·Ï°Èü2ÖеÄcÌâ

ÃèÊö ¸ø¶¨Ò»¸öÕûÊýÐòÁУ¬ÅжÏÆäÖÐÓжàÉÙ¸öÊý£¬µÈÓÚÊýÁÐÖÐÆäËûÁ½¸öÊýµÄºÍ¡£ ±ÈÈ磬¶ÔÓÚÊýÁÐ1 2 3 4, Õâ¸öÎÊÌâµÄ´ð°¸¾ÍÊÇ2, ÒòΪ3 = 2 + 1, 4 = 1 + 3¡£ ÊäÈë µÚÒ»ÐÐÊÇÒ»¸öÕûÊýT£¬±íʾһ¹²ÓжàÉÙ×éÊý¾Ý¡£ 1<= T <= 100
½ÓÏÂÀ´µÄÿ×éÊý¾Ý¹²Á½ÐУ¬µÚÒ»ÐÐÊÇÊýÁÐÖÐÊýµÄ¸öÊýn ( 1 <= n <= 100)£¬µÚ¶þÐÐÊÇÓÉn¸öÕûÊý×é³ÉµÄÊýÁС£
Êä³ö ¶ÔÓÚÿ×éÊý¾Ý£¬Êä³öÒ»¸öÕûÊý£¨Õ¼Ò»ÐУ©£¬¾ÍÊÇÊýÁÐÖеÈÓÚÆäËûÁ½¸öÊýÖ®ºÍµÄÊýµÄ¸öÊý¡£ ÑùÀýÊäÈë 2
4
1 2 3 4
5
3 5 7 9 10
ÑùÀýÊä³ö 2
1×¢Ò⣺ÕâµÀÌâ°üÀ¨0ºÍ¸ºÊý£¬¹Ê·ÝÁ½ÖÖÇé¿ö¡£#include <stdio.h>
int main(){
int n,t,m,i,j,k,sum,f,T,ff;
scanf("%d",&T);
long a[200];
while(T--){
sum=0;ff=0;
scanf("%d",&n);
for(i=1; i<=n; i++){
scanf("%ld",&a[i]);
if(a[i]<=0)
ff=1;
}
for(i=1; i<n; i++)
for(j=i+1; j<=n; j++)
if(a[i]>a[j]){
t=a[i];
a[i]=a[j];
a[j]=t;
}
if(ff==0){
for(i=n; i>2; i--){
f=0;
for(j=i-1; j>1; j--)
for(k=i-2; k>0; k--)
if(a[i]==a[j]+a[k]){
f=1;
break;
}
if(f==1)
sum++;
}
}
else{
for(i=n; i>0; i--){
f=0;
for(j=n; j>0; j--)
for(k=n; k>0; k--)
if(a[i]==a[j]+a[k]&&i!=j&&j!=k&&i!=k){
f=1;
break;
}
if(f==1)
sum++;
}
}
printf("%d\n",sum);
}
return 0;
}



Ïà¹ØÎĵµ£º

s3c2410 RTCÇý¶¯¿ò¼ÜlinuxÄÚºËÔ´Âë·ÖÎö

ʵÔÚÎÞÁÄÖоͽ«Ô­À´µÄһЩ¶«Î÷ÕûÀíÁËһϣ¬×Ô¼ºÊǸö¼ÇÐÔ²»ºÃµÄÈË£¬¸ô¶Ïʱ¼äÕûÀí×Ô¼º£¬Í¬Ê±Ò²Ï£Íû¿ÉÒÔ·½±ãËûÈË¡£
----------------------------------------------------------------------------------------------------------------------------------------
/**//*************************************************** ......

C/C++ÖеÄÈÕÆÚºÍʱ¼ä

ͻ񻣼
±¾ÎÄ´Ó½éÉÜ»ù´¡¸ÅÄîÈëÊÖ£¬Ì½ÌÖÁËÔÚC/C++ÖжÔÈÕÆÚºÍʱ¼ä²Ù×÷ËùÓõ½µÄÊý¾Ý½á¹¹ºÍº¯Êý£¬²¢¶Ô¼Æʱ¡¢Ê±¼äµÄ»ñÈ¡¡¢Ê±¼äµÄ¼ÆËãºÍÏÔʾ¸ñʽµÈ·½Ãæ½øÐÐÁ˲ûÊö¡£±¾ÎÄ»¹Í¨¹ý´óÁ¿µÄʵÀýÏòÄãչʾÁËtime.hÍ·ÎļþÖÐÉùÃ÷µÄ¸÷ÖÖº¯ÊýºÍÊý¾Ý½á¹¹µÄÏêϸʹÓ÷½·¨¡£
¹Ø¼ü×Ö£ºUTC£¨ÊÀ½ç±ê׼ʱ¼ä£©£¬Calendar Time£¨ÈÕÀúʱ¼ä£©£¬epoch£¨Ê±¼ä ......

CºÍC++ÖеÄÖ÷ÒªÊý¾ÝÀàÐͺÍ×Ö½Ú´óС

CºÍC++ÖеÄÖ÷ÒªÊý¾ÝÀàÐͺÍ×Ö½Ú´óС(
    C/C++µÄд·¨ÊDz»¿ÆѧºÍ²»ÑϽ÷µÄ¡£ÒòΪCºÍC++ËäÈ»ÓïÒ壬µ«ÊÇÉè¼Æ˼ÏëÊǽṹ»¯ÓëÃæÏò¶ÔÏó. C±ê×¼¹æ·¶ÓëC++µÄ±ê×¼¹æ·¶Ò²ÊÇÁ½¸öÎı¾¡£½üÀ´×ÐϸÑо¿ÁËËüÃǵÄÊý¾ÝÀàÐÍ£¬²ÅÖªµÀÆäÀ´ÁúÈ¥Âö£¬ÕæÕý×öµ½ÆäʵËùÒÔÈ»¡£
1¡¢CÓïÑÔ¶¨ÒåÁË5ÖÖ»ù±¾Êý¾ÝÀàÐÍ
  char(×Ö·û), int(Õ ......

AndroidÔ­Éú(Native)C¿ª·¢Ö®Èý£ºÊó±êʼþƪ(²¶Êó¼Ç)


ÔÚ×öSDLÖÁAndroidµÄÒÆֲʱ£¬¼üÅÌʼþÊÇÄÜÕý³£²¶»ñµ½£¬¿´ÁËSLDµÄÔ´Â룬·¢ÏÖÓõÄdeviceÊÇ /dev/tty0£¬µ«ÊÇÊó±ê½ÐÊDz»Äܳɹ¦²¶»ñ£¬×ÜÊǵõ½ 0£¬ÔËÐÐÃüÁî²é¿´devicesʱ£¬ÏÔʾÈçÏ£º
 # cat /proc/bus/input/devices
cat /proc/bus/input/devices
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="qwerty ......

ÅжÏC?ÐÐ??¾³µÄ³ÌÐò

/*
**ÅжÏC?ÐÐ??¾³µÄ³ÌÐò
*/
/*
**¾²?³õʼ»¯
*/
int static_variable=5;
void
f()
{
 register int i1, i2, i3, i4, i5, i6, i7, i8, i9, i10;
 register char *c1, *c2, *c3, *c4, *c5, *c6, *c7 , *c8, *c9, *c10;
 extern int a_very_long_name_to_sec_how_long_they_can_be;
 double ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ