栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

2021-10-27

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

2021-10-27

台州学院1024程序员新生C语言大赛

签到题
只需明白每个人中间需要空一个位置
直接(x+1)/2 即可


签到题注意格式即可

题意大致为寻找一个数的俩边都比这更数小的组合有多少个
由于这里数据只有10000
所以我们直接暴力向俩边搜索即可
以下是c++版
c语言替换输入输出即可

include 
#include
using namespace std;
typedef long long ll;
const int N=1e4+5;
ll sum[N],a[N];
int main()
{
  int t;
  cin>>t;
  for(int i=1;i<=t;i++)
  {
  	cin>>a[i];
	  
  }
  
   ll ans=0;
  for(int i=2;i<=t-1;i++)
  {
  	ll x=0,y=0;
  	   for(int j=1;j 


简单模拟
需要在进行运动是对操作简化到几种类型
以下是c++版
c语言替换输入输出即可

#include 
#include
using namespace std;
typedef long long ll;
const int N=1e4+5;
 int n,m,q,s,e,t;
void move(char c)
{
	if(c=='U')
	{
		t=t%(m*2);
		if(t>=e+m)
		e=2*m+e-t;
	    else if(t>e&&t=2*m-e)
		e=t+e-2*m;
	    else if(t>m-e&&t<2*m-e)
	    {
		e=2*m-e-t;
	    }
	    else if(t+e<=m)
	    e+=t;
	  
		return ;
	}
	if(c=='L')
	{
			t=t%(n*2);
		if(t>=s+n)
		s=2*n+s-t;
	    else if(t>s&&t=2*n-s)
		s=t+s-2*n;
	    else if(t>n-s&&t<2*n-s)
	    {
		s=2*n-s-t;
	    }
	    else if(t+s<=n)
	    s+=t;
	   
		return ;
	}
	
}
int main()
{
 
  cin>>n>>m>>q;
  while(q--)
  {
  	
  	char c;
  	cin>>s>>e>>t>>c;
  	move(c);
  	cout< 

7262: maomeng的答题卡
也算签到题
考察对字符串的处理
唯一就是在输出的时候要搞你一下,记得对换一下x,y的坐标
我这里使用了string类
C语言用char类型进行遍历即可

include 
#include
using namespace std;
typedef long long ll;
const int N=1e4+5;
ll ans[100][100];
int main()
{
   int n,m;
   cin>>n>>m;
   memset(ans,0,sizeof(ans));
   while(m--)
   {
   	
   	string s;
   	cin>>s;
      for(int i=1;i+s.size()<=4;i++)
      s='0'+s;
      //cout<=1;j--)
	  {
	  for( int i=1;i<=n;i++)
	  {

	 
	  	//cout<
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/352729.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号