程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> C語言 >> C++ >> C++入門知識 >> NYOJ 448 Ñ°ÕÒ×î´óÊý

NYOJ 448 Ñ°ÕÒ×î´óÊý

編輯:C++入門知識

NYOJ 448 Ñ°ÕÒ×î´óÊý


Ñ°ÕÒ×î´óÊý

ʱ¼äÏÞÖÆ£º1000 ms | ÄÚ´æÏÞÖÆ£º65535 KB ÄѶȣº2
ÃèÊö

ÇëÔÚÕûÊý n ÖÐɾ³ým¸öÊý×Ö, ʹµÃÓàϵÄÊý×Ö°´Ô­´ÎÐò×é³ÉµÄÐÂÊý×î´ó£¬

±ÈÈçµ±n=92081346718538£¬m=10ʱ£¬ÔòеÄ×î´óÊýÊÇ9888

ÊäÈë
µÚÒ»ÐÐÊäÈëÒ»¸öÕýÕûÊýT£¬±íʾÓÐT×é²âÊÔÊý¾Ý
ÿ×é²âÊÔÊý¾ÝÕ¼Ò»ÐУ¬Ã¿ÐÐÓÐÁ½¸öÊýn,m£¨n¿ÉÄÜÊÇÒ»¸öºÜ´óµÄÕûÊý£¬µ«ÆäλÊý²»³¬¹ý100룬²¢ÇÒ±£Ö¤Êý¾ÝÊ×λ·Ç0£¬mСÓÚÕûÊýnµÄλÊý£©
Êä³ö
ÿ×é²âÊÔÊý¾ÝµÄÊä³öÕ¼Ò»ÐУ¬Êä³öÊ£ÓàµÄÊý×Ö°´Ô­´ÎÐò×é³ÉµÄ×î´óÐÂÊý
ÑùÀýÊäÈë
2
92081346718538 10
1008908 5
ÑùÀýÊä³ö
9888
98

/*Ìâ½â£º Ì°ÐIJßÂÔ£¬Ã¿´ÎÇó³ö¾Ö²¿×îÓŴﵽȫ¾Ö×îÓÅ¡£ */

\ <†·Ÿ"http://www.Bkjia.com/kf/ware/vc/" target="_blank" class="keylink">vcD48cD612tK7tM6jutPJ09rX7tbVvfbK5LP2NLj2yv2jrLnKtdrSu7TO0qrV0jWhojOhojjWrsewtcTK/dbQ1+6087XEyv2jrLzHwrzPwrHqsqLK5LP2oaMKPC9wPjxwPrXatv60zqO61Nq12tK7tM7V0rP2tcTX7rTzyv3WrrrzILrNIDOhojjWrsewtcTK/dbQ1+6087XEyv2jrLzHwrzPwrHqsqLK5LP2oaM8L3A+PHA+tdrI/bTOo7rU2rXatv60ztXSs/a1xNfutPPK/dauuvMgus0gONaux7C1xMr91tDX7rTztcTK/aOsvMfCvM/Cseqyosrks/ahowo8L3A+PHA+0sC0y8DgzcajqMjnyc/NvKOpLi4uLi4u1rHWwaOoZW5kPj1sZW4pPC9wPteq19Sjumh0dHA6Ly9ibG9nLmNzZG4ubmV0L3UwMTM4MDY4MTQvYXJ0aWNsZS9kZXRhaWxzLzM5NDI5Njc1PC9wcmU+CjxkZD4KPHByZSBjbGFzcz0="brush:java;">AC´úÂë

# include 
# include 
int main(void)
{
	int t,i,flag,len,st,m,end;
	char max;
	char c[110];
	scanf("%d", &t);
	while (t--)
	{
		scanf("%s %d",&c, &m);
		len = strlen(c);
		st = i = 0; end = m;
		while (end < len)
		{
			for (i = flag = st,max = c[st]; i <= end; i++)
				if (max < c[i])
				{
					flag = i; 
					max = c[i];
				}
				st = flag + 1;
				end++;
				printf("%c",max);
		}
		printf("\n");
	}
	return 0;
}
×îÓÅ´úÂ룺

#include 02.#include 03.int main()04.{05.int k,l,max,z;06.char s[105],ans[105];07.scanf("%d",&z);08.while(z--)09.{10.scanf("%s%d",s,&k);11.l = strlen(s);12.for(int i=0,q=-1;i13.{14.max = 0;15.for(int j=q+1;j<=k+i;j++)16.if(max < s[j])17.max = s[j] , q = j;18.ans[i] = max;19.}20.ans[l-k] = '\0';21.puts(ans);22.}23.return 0;24.}
#include 02.#include 03.int main() 04.{ 05.int k,l,max,z; 06.char s[105],ans[105]; 07.scanf("%d",&z); 08.while(z--) 09.{ 10.scanf("%s%d",s,&k); 11.l = strlen(s); 12.for(int i=0,q=-1;i 13.{ 14.max = 0; 15.for(int j=q+1;j<=k+i;j++) 16.if(max < s[j]) 17.max = s[j] , q = j; 18.ans[i] = max; 19.} 20.ans[l-k] = '\0'; 21.puts(ans); 22.} 23.return 0; 24.}

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved