码迷,mamicode.com
首页 > 其他好文 > 详细

csu oj 1341 string and arrays

时间:2018-09-26 12:17:02      阅读:115      评论:0      收藏:0      [点我收藏+]

标签:details   输入   include   har   超过   syn   地址   detail   string   

/*
#include <iostream>
using namespace std;
char c[301][301];
int t, n, m, sum, x, y;
char f(int n,int x,int y,int sum)
{
 if (sum == 0)return c[x][y];
 if (sum == 1)return c[y][n+1-x];
 if (sum == 2)return c[n + 1 - x][n + 1 - y];
 if (sum == 3)return c[n+1-y][x];
}
int main()
{
 ios_base::sync_with_stdio(false);
 char ch;
 cin >> t;
 while (t--)
 {
  cin >> n;
  for (int i = 1; i <= n; i++)
  for (int j = 1; j <= n; j++)
    cin >> c[i][j];
  cin >> m ;
  sum = 0;
  while (m--)
  {
   cin >> ch;
   if (ch == ‘R‘)sum++; 
   else
   {
    cin >> x >> y;
    cout << f(n,x,y,sum%4) << endl;
   }
  }
  cout << endl;
 }
 return 0;
}
*/
//--------------------
//本文来自 csuzhucong 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/nameofcsdn/article/details/79964870?utm_source=copy
/
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
using namespace std;
int main()
{
 char s[6];
// for(int i=0;i<6;i++){
//  scanf("%c",&s[i]);
// }
// scanf("%s",s);
cin>>s;
    printf("%s",s); 
 cout<<s;
 return 0;
}
 

//cin和scanf("%s")很像,只能读入非空格符和非换行符,如果第一个输入的字符就是空格,则忽略;如果第一个不是空格,则读到有空格或者换行符为止
//scanf("%c")则可以读取输入空格符和换行符。当读入的字符串小于定义的空间时,即使输入换行符,也不会结束输入,只有输入的超过空间时,输入换行符才会停止输入
 // 如果输入的最后一个空间恰好是换行,则停止输入;
 
 
 
 
 
 
 

csu oj 1341 string and arrays

标签:details   输入   include   har   超过   syn   地址   detail   string   

原文地址:https://www.cnblogs.com/hcw110/p/9706094.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!